Unofficial OpenAI SDK/client for Haskell. It's generated via servant-client
from openai-servant
with a small amount of hand-written code. Contributions are welcome!
See openai-hs for more details.
Unofficial OpenAI Haskell Bindings
Home Page: https://hackage.haskell.org/package/openai-hs
Unofficial OpenAI SDK/client for Haskell. It's generated via servant-client
from openai-servant
with a small amount of hand-written code. Contributions are welcome!
See openai-hs for more details.
anyone got thoughts on the best way to do caching of responses? i've been trying to do it at the HTTP level with squid, but it really starts to get fragile and baroque when you're dealing with POSTs.
I think you should bump the version with the significant Mar 23 update and push it to hackage.
Currently Hackage and this repo are both 0.2.2.0 (https://hackage.haskell.org/package/openai-hs-0.2.2.0) where the current state should probably be called 0.3?
The arguments field of a function call object is not guaranteed to be valid JSON, here's the relevant quote from the API reference
The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
Currently if there is a problem in arguments
we get a DecodeFailure ... :: ClientError
from completeChat
, which makes it harder to recover from, because we do not have access to the other parts of the response, which are likely valid.
Hi there, this library looks pretty cool. Have you thought about adding it to the list of community maintained libraries? How "complete" is the current state of the library?
Adding your API client to the Community Libraries page
Best regards
The documentation is a bit hairy about it, but apparently a ChatCompletionMessage
can take a function_call
parameter to force calling a particular function specified in the functions
list, see for example:
From a passage of the first link:
If you want to force the model to call a specific function you can do so by setting function_call: {"name": ""}. You can also force the model to generate a user-facing message by setting function_call: "none". Note that the default behavior (function_call: "auto") is for the model to decide on its own whether to call a function and if so which function to call.
According to the documentation, null
is a valid value, so this could be modelled as a Maybe ChatFunction
or similar.
When doing requests in parallel it's not too hard to hit rate limits:
https://platform.openai.com/docs/guides/rate-limits
Would be great to have rate limiting support, e.g. across all clients generated from the same Manager.
tehres a cabal field for build tool deps, then it wouldn't fail for users who dont have cpphs installed...
This is a very helpful package and I think it would be cool to include in Stackage!
https://github.com/commercialhaskell/stackage/blob/master/MAINTAINERS.md#adding-a-package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.