This Elixir library provides a community-maintained wrapper for the OpenAI REST APIs, targeting Elixir developers who want to integrate OpenAI's language models and services into their applications. It offers a comprehensive interface to various OpenAI functionalities, including text generation, image manipulation, audio processing, and the newer Assistants API.
How It Works
The library leverages Elixir's concurrency and fault-tolerance features, built on top of the HTTPoison
HTTP client. It maps OpenAI's REST endpoints to Elixir functions, handling request formatting, authentication, and response parsing. Configuration is managed via mix.exs
or config.exs
, allowing for API key management and custom HTTP options. Runtime configuration overrides are also supported for dynamic adjustments.
Quick Start & Requirements
:openai
to your mix.exs
dependencies.api_key
and optionally organization_key
and beta
parameters in config.exs
.OpenAI.chat_completion/1
or OpenAI.images_generations/2
.Highlighted Details
Maintenance & Community
The project is community-maintained, with a disclaimer about potential delays in addressing issues or pull requests due to the maintainer's other commitments. Alternative libraries are linked for users seeking more active development.
Licensing & Compatibility
Limitations & Caveats
The README explicitly states that issue and PR response times may be delayed, and the library may not always reflect the latest API specifications. Some newer functionalities, like threads()
and threads(params)
, are noted as undocumented by OpenAI at the time of writing.
1 year ago
1 week