package openai

Not available on OCaml 5.5
  1. Overview
  2. Docs
OCaml OpenAI binding

Install

dune-project
 Dependency

Authors

Maintainers

Sources

openai-ocaml-0.0.1.tbz
sha256=aa7947b57001796a65e39cfed9c80338d08c5e2b7f2e32d0e6c19e1446395b18
sha512=46b236cb9bb25233fd4026d9593d161ced0f54b223c6d97ae3d981e2b36355ff60fd80cdefe7c6a247ef36251fe02999a65416b8fbfad50079232b9cb6cbc318

Description

Added to opam-repository:

README

OpenAI-OCaml

$ cat src/test.ml
open Openai

let run () =
  let api_key = Sys.getenv "OPENAI_API_KEY" in
  let client = Client.create api_key in
  ignore
  @@ Lwt_main.run
  @@ Lwt.bind
       Chat_completion.(
         send
           client
           ~temperature:0.0
           ~max_tokens:22
           ~messages:
             [ { role = `System; content = "" }
             ; { role = `User; content = {|枕草子曰く、春は"あけぼの"、夜は"月"。では、秋は?|} }
             ]
           ())
       (Lwt_io.printlf "res: %s")
;;

let () = run ()
$ export OPENAI_API_KEY=...
$ dune test
res: 枕草子によると、秋は「夕暮れ」です。

Dependencies (7)

  1. ezcurl-lwt < "0.3"
  2. conf-openssl
  3. lwt_ppx
  4. ppx_yojson_conv < "v0.16.0"
  5. ppx_yojson
  6. dune >= "3.7.0"
  7. ocaml >= "4.14.0"

Dev Dependencies

None

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building openai with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.0.1 (this version) n/a good good n/a n/a
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure