GithubHelp home page GithubHelp logo

agrafix / openai-hs Goto Github PK

View Code? Open in Web Editor NEW
46.0 5.0 22.0 58 KB

Unofficial OpenAI Haskell Bindings

Home Page: https://hackage.haskell.org/package/openai-hs

Haskell 98.78% Shell 1.22%
haskell openai gpt3 gpt-3 machine-learning sdk

openai-hs's Introduction

Unofficial OpenAI Haskell Bindings

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.

openai-hs's People

Contributors

adinapoli avatar agrafix avatar andrew-lei avatar gabriella439 avatar jkoppel avatar miezhiko avatar mlang avatar nickhs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openai-hs's Issues

caching best practices?

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.

`arguments` field of `ChatFunctionCall` should be `Text` rather than `Value`

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.

Add `function_call` to `ChatCompletionMessage`

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.

add cpphs to build-depends?

tehres a cabal field for build tool deps, then it wouldn't fail for users who dont have cpphs installed...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.