pub struct OpenAI { /* private fields */ }Expand description
The main OpenAI client.
Implementations§
Source§impl OpenAI
impl OpenAI
Sourcepub fn with_config(config: ClientConfig) -> Self
pub fn with_config(config: ClientConfig) -> Self
Create a client from a full config.
Sourcepub fn from_env() -> Result<Self, OpenAIError>
pub fn from_env() -> Result<Self, OpenAIError>
Create a client using the OPENAI_API_KEY environment variable.
Sourcepub fn beta(&self) -> Beta<'_>
pub fn beta(&self) -> Beta<'_>
Access the Beta resources (Assistants, Threads, Runs, Vector Stores).
Sourcepub fn fine_tuning(&self) -> FineTuning<'_>
pub fn fine_tuning(&self) -> FineTuning<'_>
Access the Fine-tuning resource.
Sourcepub fn moderations(&self) -> Moderations<'_>
pub fn moderations(&self) -> Moderations<'_>
Access the Moderations resource.
Sourcepub fn embeddings(&self) -> Embeddings<'_>
pub fn embeddings(&self) -> Embeddings<'_>
Access the Embeddings resource.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenAI
impl !RefUnwindSafe for OpenAI
impl Send for OpenAI
impl Sync for OpenAI
impl Unpin for OpenAI
impl UnsafeUnpin for OpenAI
impl !UnwindSafe for OpenAI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more