pub struct ClientConfig {
pub api_key: String,
pub base_url: String,
pub organization: Option<String>,
pub project: Option<String>,
pub timeout_secs: u64,
pub max_retries: u32,
}Expand description
Configuration for the OpenAI client.
Fields§
§api_key: String§base_url: String§organization: Option<String>§project: Option<String>§timeout_secs: u64§max_retries: u32Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn from_env() -> Result<Self, OpenAIError>
pub fn from_env() -> Result<Self, OpenAIError>
Create config from the OPENAI_API_KEY environment variable.
pub fn base_url(self, url: impl Into<String>) -> Self
pub fn organization(self, org: impl Into<String>) -> Self
pub fn project(self, project: impl Into<String>) -> Self
pub fn timeout_secs(self, secs: u64) -> Self
pub fn max_retries(self, retries: u32) -> Self
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
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 moreAuto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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