pub struct AnthropicModelConfigBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> AnthropicModelConfigBuilder<S>
impl<S: State> AnthropicModelConfigBuilder<S>
Sourcepub fn build(self) -> AnthropicModelConfigwhere
S: IsComplete,
pub fn build(self) -> AnthropicModelConfigwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn model_id(
self,
value: impl Into<String>,
) -> AnthropicModelConfigBuilder<SetModelId<S>>where
S::ModelId: IsUnset,
pub fn model_id(
self,
value: impl Into<String>,
) -> AnthropicModelConfigBuilder<SetModelId<S>>where
S::ModelId: IsUnset,
Sourcepub fn maybe_model_id(
self,
value: Option<impl Into<String>>,
) -> AnthropicModelConfigBuilder<SetModelId<S>>where
S::ModelId: IsUnset,
pub fn maybe_model_id(
self,
value: Option<impl Into<String>>,
) -> AnthropicModelConfigBuilder<SetModelId<S>>where
S::ModelId: IsUnset,
Sourcepub fn max_tokens(
self,
value: u64,
) -> AnthropicModelConfigBuilder<SetMaxTokens<S>>where
S::MaxTokens: IsUnset,
pub fn max_tokens(
self,
value: u64,
) -> AnthropicModelConfigBuilder<SetMaxTokens<S>>where
S::MaxTokens: IsUnset,
Sourcepub fn maybe_max_tokens(
self,
value: Option<u64>,
) -> AnthropicModelConfigBuilder<SetMaxTokens<S>>where
S::MaxTokens: IsUnset,
pub fn maybe_max_tokens(
self,
value: Option<u64>,
) -> AnthropicModelConfigBuilder<SetMaxTokens<S>>where
S::MaxTokens: IsUnset,
Sourcepub fn temperature(
self,
value: f64,
) -> AnthropicModelConfigBuilder<SetTemperature<S>>where
S::Temperature: IsUnset,
pub fn temperature(
self,
value: f64,
) -> AnthropicModelConfigBuilder<SetTemperature<S>>where
S::Temperature: IsUnset,
Sourcepub fn maybe_temperature(
self,
value: Option<f64>,
) -> AnthropicModelConfigBuilder<SetTemperature<S>>where
S::Temperature: IsUnset,
pub fn maybe_temperature(
self,
value: Option<f64>,
) -> AnthropicModelConfigBuilder<SetTemperature<S>>where
S::Temperature: IsUnset,
Sourcepub fn top_p(self, value: f64) -> AnthropicModelConfigBuilder<SetTopP<S>>where
S::TopP: IsUnset,
pub fn top_p(self, value: f64) -> AnthropicModelConfigBuilder<SetTopP<S>>where
S::TopP: IsUnset,
Sourcepub fn maybe_top_p(
self,
value: Option<f64>,
) -> AnthropicModelConfigBuilder<SetTopP<S>>where
S::TopP: IsUnset,
pub fn maybe_top_p(
self,
value: Option<f64>,
) -> AnthropicModelConfigBuilder<SetTopP<S>>where
S::TopP: IsUnset,
Sourcepub fn context_window_limit(
self,
value: u64,
) -> AnthropicModelConfigBuilder<SetContextWindowLimit<S>>where
S::ContextWindowLimit: IsUnset,
pub fn context_window_limit(
self,
value: u64,
) -> AnthropicModelConfigBuilder<SetContextWindowLimit<S>>where
S::ContextWindowLimit: IsUnset,
Sourcepub fn maybe_context_window_limit(
self,
value: Option<u64>,
) -> AnthropicModelConfigBuilder<SetContextWindowLimit<S>>where
S::ContextWindowLimit: IsUnset,
pub fn maybe_context_window_limit(
self,
value: Option<u64>,
) -> AnthropicModelConfigBuilder<SetContextWindowLimit<S>>where
S::ContextWindowLimit: IsUnset,
Sourcepub fn model_info(
self,
value: ModelInfo,
) -> AnthropicModelConfigBuilder<SetModelInfo<S>>where
S::ModelInfo: IsUnset,
pub fn model_info(
self,
value: ModelInfo,
) -> AnthropicModelConfigBuilder<SetModelInfo<S>>where
S::ModelInfo: IsUnset,
Sourcepub fn maybe_model_info(
self,
value: Option<ModelInfo>,
) -> AnthropicModelConfigBuilder<SetModelInfo<S>>where
S::ModelInfo: IsUnset,
pub fn maybe_model_info(
self,
value: Option<ModelInfo>,
) -> AnthropicModelConfigBuilder<SetModelInfo<S>>where
S::ModelInfo: IsUnset,
Sourcepub fn stop_sequences(
self,
value: Vec<String>,
) -> AnthropicModelConfigBuilder<SetStopSequences<S>>where
S::StopSequences: IsUnset,
pub fn stop_sequences(
self,
value: Vec<String>,
) -> AnthropicModelConfigBuilder<SetStopSequences<S>>where
S::StopSequences: IsUnset,
Sourcepub fn maybe_stop_sequences(
self,
value: Option<Vec<String>>,
) -> AnthropicModelConfigBuilder<SetStopSequences<S>>where
S::StopSequences: IsUnset,
pub fn maybe_stop_sequences(
self,
value: Option<Vec<String>>,
) -> AnthropicModelConfigBuilder<SetStopSequences<S>>where
S::StopSequences: IsUnset,
Sourcepub fn params(
self,
value: JsonValue,
) -> AnthropicModelConfigBuilder<SetParams<S>>where
S::Params: IsUnset,
pub fn params(
self,
value: JsonValue,
) -> AnthropicModelConfigBuilder<SetParams<S>>where
S::Params: IsUnset,
Optional (Some / Option setters).
Extra request fields, merged over the formatted request. Extended thinking goes here, for
example {"thinking": {"type": "enabled", "budget_tokens": 1024}} or
{"thinking": {"type": "adaptive"}}. Server tools under tools are appended like
anthropic_tools. Must be a JSON object, such as a json!({..})
literal.
Sourcepub fn maybe_params(
self,
value: Option<JsonValue>,
) -> AnthropicModelConfigBuilder<SetParams<S>>where
S::Params: IsUnset,
pub fn maybe_params(
self,
value: Option<JsonValue>,
) -> AnthropicModelConfigBuilder<SetParams<S>>where
S::Params: IsUnset,
Optional (Some / Option setters).
Extra request fields, merged over the formatted request. Extended thinking goes here, for
example {"thinking": {"type": "enabled", "budget_tokens": 1024}} or
{"thinking": {"type": "adaptive"}}. Server tools under tools are appended like
anthropic_tools. Must be a JSON object, such as a json!({..})
literal.
Sourcepub fn anthropic_tools(
self,
value: Vec<JsonValue>,
) -> AnthropicModelConfigBuilder<SetAnthropicTools<S>>where
S::AnthropicTools: IsUnset,
pub fn anthropic_tools(
self,
value: Vec<JsonValue>,
) -> AnthropicModelConfigBuilder<SetAnthropicTools<S>>where
S::AnthropicTools: IsUnset,
Optional (Some / Option setters).
Anthropic server-side tools, such as
{"type": "web_search_20260318", "name": "web_search"}, web_fetch and code_execution,
appended after the agent’s function tools. Function tools (with an input_schema) are
rejected; use the agent’s tools for those. Each entry must be a JSON object.
Sourcepub fn maybe_anthropic_tools(
self,
value: Option<Vec<JsonValue>>,
) -> AnthropicModelConfigBuilder<SetAnthropicTools<S>>where
S::AnthropicTools: IsUnset,
pub fn maybe_anthropic_tools(
self,
value: Option<Vec<JsonValue>>,
) -> AnthropicModelConfigBuilder<SetAnthropicTools<S>>where
S::AnthropicTools: IsUnset,
Optional (Some / Option setters).
Anthropic server-side tools, such as
{"type": "web_search_20260318", "name": "web_search"}, web_fetch and code_execution,
appended after the agent’s function tools. Function tools (with an input_schema) are
rejected; use the agent’s tools for those. Each entry must be a JSON object.
Sourcepub fn betas(
self,
value: Vec<String>,
) -> AnthropicModelConfigBuilder<SetBetas<S>>where
S::Betas: IsUnset,
pub fn betas(
self,
value: Vec<String>,
) -> AnthropicModelConfigBuilder<SetBetas<S>>where
S::Betas: IsUnset,
Sourcepub fn maybe_betas(
self,
value: Option<Vec<String>>,
) -> AnthropicModelConfigBuilder<SetBetas<S>>where
S::Betas: IsUnset,
pub fn maybe_betas(
self,
value: Option<Vec<String>>,
) -> AnthropicModelConfigBuilder<SetBetas<S>>where
S::Betas: IsUnset,
Sourcepub fn use_native_token_count(
self,
value: bool,
) -> AnthropicModelConfigBuilder<SetUseNativeTokenCount<S>>where
S::UseNativeTokenCount: IsUnset,
pub fn use_native_token_count(
self,
value: bool,
) -> AnthropicModelConfigBuilder<SetUseNativeTokenCount<S>>where
S::UseNativeTokenCount: IsUnset,
Optional (Some / Option setters).
Whether Model::count_tokens calls the token counting API instead of estimating. Default
false.
Sourcepub fn maybe_use_native_token_count(
self,
value: Option<bool>,
) -> AnthropicModelConfigBuilder<SetUseNativeTokenCount<S>>where
S::UseNativeTokenCount: IsUnset,
pub fn maybe_use_native_token_count(
self,
value: Option<bool>,
) -> AnthropicModelConfigBuilder<SetUseNativeTokenCount<S>>where
S::UseNativeTokenCount: IsUnset,
Optional (Some / Option setters).
Whether Model::count_tokens calls the token counting API instead of estimating. Default
false.
Sourcepub fn cache_config(
self,
value: CacheConfig,
) -> AnthropicModelConfigBuilder<SetCacheConfig<S>>where
S::CacheConfig: IsUnset,
pub fn cache_config(
self,
value: CacheConfig,
) -> AnthropicModelConfigBuilder<SetCacheConfig<S>>where
S::CacheConfig: IsUnset,
Sourcepub fn maybe_cache_config(
self,
value: Option<CacheConfig>,
) -> AnthropicModelConfigBuilder<SetCacheConfig<S>>where
S::CacheConfig: IsUnset,
pub fn maybe_cache_config(
self,
value: Option<CacheConfig>,
) -> AnthropicModelConfigBuilder<SetCacheConfig<S>>where
S::CacheConfig: IsUnset,
Auto Trait Implementations§
impl<S> Freeze for AnthropicModelConfigBuilder<S>
impl<S> RefUnwindSafe for AnthropicModelConfigBuilder<S>
impl<S> Send for AnthropicModelConfigBuilder<S>
impl<S> Sync for AnthropicModelConfigBuilder<S>
impl<S> Unpin for AnthropicModelConfigBuilder<S>
impl<S> UnsafeUnpin for AnthropicModelConfigBuilder<S>
impl<S> UnwindSafe for AnthropicModelConfigBuilder<S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more