pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Create via:
ClientBuilder::default()Client::builder()
Implementations§
Source§impl ClientBuilder
Builder methods
impl ClientBuilder
Builder methods
Sourcepub fn with_reqwest(self, reqwest_client: Client) -> Self
pub fn with_reqwest(self, reqwest_client: Client) -> Self
Use a custom reqwest::Client.
Sourcepub fn with_config(self, config: ClientConfig) -> Self
pub fn with_config(self, config: ClientConfig) -> Self
Set a ClientConfig.
Sourcepub fn with_web_config(self, req_options: WebConfig) -> Self
pub fn with_web_config(self, req_options: WebConfig) -> Self
Set WebConfig used to build the internal reqwest::Client (creates ClientConfig if absent).
Source§impl ClientBuilder
Builder ClientConfig passthrough convenient setters.
The goal of these functions is to set nested values such as Client Config and ChatOptions for the client.
impl ClientBuilder
Builder ClientConfig passthrough convenient setters. The goal of these functions is to set nested values such as Client Config and ChatOptions for the client.
Sourcepub fn with_chat_options(self, options: ChatOptions) -> Self
pub fn with_chat_options(self, options: ChatOptions) -> Self
Set ChatOptions on ClientConfig (creates it if absent).
Sourcepub fn with_auth_resolver(self, auth_resolver: AuthResolver) -> Self
pub fn with_auth_resolver(self, auth_resolver: AuthResolver) -> Self
Set AuthResolver on ClientConfig (creates it if absent).
Sourcepub fn with_auth_resolver_fn(
self,
auth_resolver_fn: impl IntoAuthResolverFn,
) -> Self
pub fn with_auth_resolver_fn( self, auth_resolver_fn: impl IntoAuthResolverFn, ) -> Self
Set AuthResolver from a resolver function (creates ClientConfig if absent).
Sourcepub fn with_service_target_resolver(
self,
target_resolver: ServiceTargetResolver,
) -> Self
pub fn with_service_target_resolver( self, target_resolver: ServiceTargetResolver, ) -> Self
Set ServiceTargetResolver on ClientConfig (creates it if absent).
Sourcepub fn with_service_target_resolver_fn(
self,
target_resolver_fn: impl IntoServiceTargetResolverFn,
) -> Self
pub fn with_service_target_resolver_fn( self, target_resolver_fn: impl IntoServiceTargetResolverFn, ) -> Self
Set ServiceTargetResolver from a resolver function (creates ClientConfig if absent).
Sourcepub fn with_model_mapper(self, model_mapper: ModelMapper) -> Self
pub fn with_model_mapper(self, model_mapper: ModelMapper) -> Self
Set ModelMapper on ClientConfig (creates it if absent).
Sourcepub fn with_model_mapper_fn(
self,
model_mapper_fn: impl IntoModelMapperFn,
) -> Self
pub fn with_model_mapper_fn( self, model_mapper_fn: impl IntoModelMapperFn, ) -> Self
Set ModelMapper from a mapper function (creates ClientConfig if absent).
Sourcepub fn with_adapter_kind(self, adapter_kind: AdapterKind) -> Self
pub fn with_adapter_kind(self, adapter_kind: AdapterKind) -> Self
Bind the Client to a single AdapterKind (creates ClientConfig if absent).
See ClientConfig::with_adapter_kind for semantics. Short version:
a Client whose AuthResolver / ServiceTargetResolver are gated on an
adapter is already physically single-provider; this makes that
constraint explicit and drives routing directly instead of inferring
the adapter from the model name on every call.