pub struct OpenAiProvider { /* private fields */ }Expand description
Calls {base}/chat/completions with an OpenAI-compatible API.
Supports all OpenAI chat models and any compatible endpoint:
gpt-4o-mini— fast and cheap (default)gpt-4o— most capable- Any model exposed by an OpenAI-compatible API
Set OPENAI_API_KEY to your API key.
Override model with OPENAI_MODEL.
Override base URL with OPENAI_API_BASE (e.g. http://localhost:11434/v1 for Ollama).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenAiProvider
impl !RefUnwindSafe for OpenAiProvider
impl Send for OpenAiProvider
impl Sync for OpenAiProvider
impl Unpin for OpenAiProvider
impl UnsafeUnpin for OpenAiProvider
impl !UnwindSafe for OpenAiProvider
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