pub struct OpenAIConfig {
pub api_endpoint: Option<String>,
pub api_key: Option<String>,
}Expand description
Configuration for OpenAI provider
Fields§
§api_endpoint: Option<String>§api_key: Option<String>Implementations§
Source§impl OpenAIConfig
impl OpenAIConfig
Sourcepub fn with_api_key(api_key: impl Into<String>) -> Self
pub fn with_api_key(api_key: impl Into<String>) -> Self
Create config with API key
Sourcepub fn from_provider_auth(auth: &ProviderAuth) -> Option<Self>
pub fn from_provider_auth(auth: &ProviderAuth) -> Option<Self>
Create config from ProviderAuth (only supports API key for OpenAI)
Sourcepub fn with_provider_auth(self, auth: &ProviderAuth) -> Option<Self>
pub fn with_provider_auth(self, auth: &ProviderAuth) -> Option<Self>
Merge with credentials from ProviderAuth, preserving existing endpoint
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
Source§impl Default for OpenAIConfig
impl Default for OpenAIConfig
Source§fn default() -> OpenAIConfig
fn default() -> OpenAIConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OpenAIConfig
impl<'de> Deserialize<'de> for OpenAIConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for OpenAIConfig
impl PartialEq for OpenAIConfig
Source§impl Serialize for OpenAIConfig
impl Serialize for OpenAIConfig
impl StructuralPartialEq 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