pub struct OpenAiFactory;Expand description
Factory for creating OpenAiProvider instances from configuration.
Register this factory with the global registry to enable config-driven provider instantiation:
use llm_stack::ProviderRegistry;
use llm_stack_openai::OpenAiFactory;
ProviderRegistry::global().register(Box::new(OpenAiFactory));§Configuration
| Field | Required | Description |
|---|---|---|
provider | Yes | Must be "openai" |
api_key | Yes | OpenAI API key |
model | Yes | Model identifier (e.g., "gpt-4o") |
base_url | No | Custom API endpoint |
timeout | No | Request timeout |
extra.organization | No | OpenAI organization ID |
Trait Implementations§
Source§impl Clone for OpenAiFactory
impl Clone for OpenAiFactory
Source§fn clone(&self) -> OpenAiFactory
fn clone(&self) -> OpenAiFactory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenAiFactory
impl Debug for OpenAiFactory
Source§impl Default for OpenAiFactory
impl Default for OpenAiFactory
Source§fn default() -> OpenAiFactory
fn default() -> OpenAiFactory
Returns the “default value” for a type. Read more
Source§impl ProviderFactory for OpenAiFactory
impl ProviderFactory for OpenAiFactory
impl Copy for OpenAiFactory
Auto Trait Implementations§
impl Freeze for OpenAiFactory
impl RefUnwindSafe for OpenAiFactory
impl Send for OpenAiFactory
impl Sync for OpenAiFactory
impl Unpin for OpenAiFactory
impl UnwindSafe for OpenAiFactory
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