pub struct OpenAiConfig {
pub api_key: String,
pub model: String,
pub base_url: String,
pub organization: Option<String>,
pub timeout: Option<Duration>,
pub client: Option<Client>,
}Expand description
Configuration for the OpenAI provider.
Use struct update syntax with Default for ergonomic construction:
use llm_stack_openai::OpenAiConfig;
let config = OpenAiConfig {
api_key: "sk-...".into(),
model: "gpt-4o".into(),
..Default::default()
};Fields§
§api_key: StringOpenAI API key. Required.
model: StringModel identifier (e.g. "gpt-4o", "gpt-4o-mini").
base_url: StringBase URL for the API. Override for proxies, Azure, or local servers.
organization: Option<String>Optional organization ID for API requests.
timeout: Option<Duration>Request timeout. None uses reqwest’s default.
client: Option<Client>Pre-configured HTTP client for connection pooling across providers.
When None, a new client is created.
Trait Implementations§
Source§impl Clone for OpenAiConfig
impl Clone for OpenAiConfig
Source§fn clone(&self) -> OpenAiConfig
fn clone(&self) -> OpenAiConfig
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 OpenAiConfig
impl Debug for OpenAiConfig
Auto Trait Implementations§
impl Freeze for OpenAiConfig
impl !RefUnwindSafe for OpenAiConfig
impl Send for OpenAiConfig
impl Sync for OpenAiConfig
impl Unpin for OpenAiConfig
impl !UnwindSafe for OpenAiConfig
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