pub struct ClientConfig { /* private fields */ }Expand description
Configuration for building and customizing a Client.
Implementations§
Source§impl ClientConfig
Chainable setters related to the ClientConfig.
impl ClientConfig
Chainable setters related to the ClientConfig.
Sourcepub fn with_auth_resolver(self, auth_resolver: AuthResolver) -> Self
pub fn with_auth_resolver(self, auth_resolver: AuthResolver) -> Self
Sets the AuthResolver.
Called before service_target_resolver; if set, it will receive this value.
Sourcepub fn with_model_mapper(self, model_mapper: ModelMapper) -> Self
pub fn with_model_mapper(self, model_mapper: ModelMapper) -> Self
Sets the ModelMapper.
Called before service_target_resolver; if set, it will receive this value.
Sourcepub fn with_service_target_resolver(
self,
service_target_resolver: ServiceTargetResolver,
) -> Self
pub fn with_service_target_resolver( self, service_target_resolver: ServiceTargetResolver, ) -> Self
Sets the ServiceTargetResolver.
Final step before execution; allows full control over the resolved endpoint, auth, and model identifier.
Sourcepub fn with_chat_options(self, options: ChatOptions) -> Self
pub fn with_chat_options(self, options: ChatOptions) -> Self
Sets default ChatOptions for chat requests.
Sourcepub fn with_embed_options(self, options: EmbedOptions) -> Self
pub fn with_embed_options(self, options: EmbedOptions) -> Self
Sets default EmbedOptions for embed requests.
Sourcepub fn with_web_config(self, web_config: WebConfig) -> Self
pub fn with_web_config(self, web_config: WebConfig) -> Self
Sets the HTTP client configuration (reqwest).
Sourcepub fn web_config(&self) -> Option<&WebConfig>
pub fn web_config(&self) -> Option<&WebConfig>
Returns the WebConfig, if set.
Source§impl ClientConfig
Getters for the fields of ClientConfig (as references).
impl ClientConfig
Getters for the fields of ClientConfig (as references).
Sourcepub fn auth_resolver(&self) -> Option<&AuthResolver>
pub fn auth_resolver(&self) -> Option<&AuthResolver>
Returns the AuthResolver, if set.
Sourcepub fn service_target_resolver(&self) -> Option<&ServiceTargetResolver>
pub fn service_target_resolver(&self) -> Option<&ServiceTargetResolver>
Returns the ServiceTargetResolver, if set.
Sourcepub fn model_mapper(&self) -> Option<&ModelMapper>
pub fn model_mapper(&self) -> Option<&ModelMapper>
Returns the ModelMapper, if set.
Sourcepub fn chat_options(&self) -> Option<&ChatOptions>
pub fn chat_options(&self) -> Option<&ChatOptions>
Returns the default ChatOptions, if set.
Sourcepub fn embed_options(&self) -> Option<&EmbedOptions>
pub fn embed_options(&self) -> Option<&EmbedOptions>
Returns the default EmbedOptions, if set.
Source§impl ClientConfig
Resolvers
impl ClientConfig
Resolvers
Sourcepub async fn resolve_service_target(
&self,
model: ModelIden,
) -> Result<ServiceTarget>
pub async fn resolve_service_target( &self, model: ModelIden, ) -> Result<ServiceTarget>
Resolves a ServiceTarget for the given model.
Applies the ModelMapper (if any), resolves auth (via AuthResolver or adapter default), selects the adapter’s default endpoint, then applies the ServiceTargetResolver (if any).
Errors with Error::Resolver if any resolver step fails.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more