Description
openai-clojure is an unofficial Clojure library for driving the OpenAI API and the Azure OpenAI API. Its aim is to hide the small differences between the two, so tools built with it can work with either service. It covers chat, audio, completions, embeddings and images on both providers. Models, files, fine-tuning and moderations are listed for OpenAI only, and assistants, threads, messages, runs and vector stores are marked as beta on OpenAI. The README gives the API versions it targets, v2.3.0 for OpenAI and v2024-06-01 for Azure OpenAI. You add the library as a dependency in deps.edn or in Leiningen's project.clj, and it needs Java 11 or newer. For OpenAI, set the OPENAI_API_KEY environment variable, and optionally OPENAI_ORGANIZATION if your account uses several organizations. Azure authentication has its own section. The README includes a quickstart for a simple chat conversation and links to a full API reference with examples. The library is built on Martian, an HTTP abstraction library. It is public on GitHub under wkok, and issues and pull requests are welcome.…
Highlights
- Clojure access to OpenAI and Azure OpenAI
- Chat, audio, embeddings, images and completions
- One set of functions for both providers
- Quickstart and full API reference
- Built on the Martian HTTP library
Ratings & Reviews
No ratings yet
Be the first to rate Openai Clojure.
People also visit
Openai Clojure FAQ
What is openai-clojure?
An unofficial Clojure library for the OpenAI API and the Azure OpenAI API.
What do I need to use it?
Java 11 or newer, an OpenAI API key in OPENAI_API_KEY, and the dependency added to deps.edn or project.clj.
Which APIs are supported?
Chat, audio, completions, embeddings and images work on both providers. Models, files, fine-tuning and moderations are OpenAI only, and assistants and related features are beta on OpenAI.
Does it work with Azure OpenAI?
Yes. The library aims to hide the differences between the two services, and the README has a separate section on Azure authentication.
Where is the reference?
The README links usage guides for OpenAI and Azure, a guide to streaming tokens and a full API reference.
What are the best Openai Clojure alternatives?
Popular alternatives to Openai Clojure include Go Openai, Chat and Ruby Openai. See all Openai Clojure alternatives
