pub struct OpenAIConfigBuilder { /* private fields */ }Expand description
Builder for OpenAI configuration.
Implementations§
Source§impl OpenAIConfigBuilder
impl OpenAIConfigBuilder
Sourcepub fn api_key(self, api_key: impl Into<SecretString>) -> Self
pub fn api_key(self, api_key: impl Into<SecretString>) -> Self
Set the API key.
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Result<Self, ConfigError>
pub fn base_url(self, base_url: impl Into<String>) -> Result<Self, ConfigError>
Set the base URL.
Sourcepub fn organization(self, organization: impl Into<String>) -> Self
pub fn organization(self, organization: impl Into<String>) -> Self
Set the organization.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Set the maximum number of retries.
Sourcepub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set a custom HTTP header.
Sourcepub fn build(self) -> OpenAIConfig
pub fn build(self) -> OpenAIConfig
Build the configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenAIConfigBuilder
impl RefUnwindSafe for OpenAIConfigBuilder
impl Send for OpenAIConfigBuilder
impl Sync for OpenAIConfigBuilder
impl Unpin for OpenAIConfigBuilder
impl UnwindSafe for OpenAIConfigBuilder
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