Expand description
An opinionated wrapper around the OpenAI API. This does not support all endpoints, and is not automatically generated.
Re-exports§
pub use error::OpenAIError;
pub use error::OpenAIResult;
Modules§
Macros§
- assistant_
message - logit_
bias - reasoning_
assistant_ message - reasoning_
developer_ message - reasoning_
user_ message - system_
message - user_
message
Structs§
- Environment
Auth Token Provider - Auth token provided that takes the auth token from the environment variable
OPENAI_API_KEY
. - Generated
OpenAI Schema - An OpenAI-compatible JSON schema produced by the
OpenAI
schema derive macro. - OpenAI
- A handle to OpenAI.
- Usage
- The token usage of a request.
Traits§
- Auth
Token Provider - Any type that can provide a bearer auth token.
- OpenAI
Schema - Any type that can be used as a structured chat completion.
- Subordinate
OpenAI Schema - A subordinate type that can be used as a field in an OpenAI schema but not as the schema itself.
(
enum
s and eventuallystruct
s when supported using$ref
). This is still derived byOpenAISchema
, so for all intents and purposes you can pretend that this type doesn’t exist.
Derive Macros§
- OpenAI
Schema - Places an associated function on a struct that returns an
&'static str
containing its OpenAI-compatible JSON schema.