Skip to main content

BedrockModelConfig

Struct BedrockModelConfig 

Source
pub struct BedrockModelConfig {
Show 16 fields pub model_id: Option<String>, pub max_tokens: Option<u64>, pub temperature: Option<f64>, pub top_p: Option<f64>, pub context_window_limit: Option<u64>, pub model_info: Option<ModelInfo>, pub stop_sequences: Option<Vec<String>>, pub cache_config: Option<BedrockCacheConfig>, pub additional_request_fields: Option<JsonValue>, pub additional_response_field_paths: Option<Vec<String>>, pub additional_args: Option<JsonValue>, pub stream: Option<bool>, pub include_tool_result_status: Option<IncludeToolResultStatus>, pub guardrail_config: Option<BedrockGuardrailConfig>, pub use_native_token_count: Option<bool>, pub strict_tools: Option<bool>,
}
Expand description

Configuration of a BedrockModel (BedrockModelConfig): the BaseModelConfig fields plus the Bedrock knobs.

use strands::models::bedrock::BedrockModelConfig;

let config = BedrockModelConfig {
    model_id: Some("global.anthropic.claude-sonnet-4-6".into()),
    max_tokens: Some(1024),
    temperature: Some(0.7),
    ..Default::default()
};
assert_eq!(config.to_base().max_tokens, Some(1024));

Fields§

§model_id: Option<String>

The Bedrock model id, inference profile id or ARN. Default global.anthropic.claude-sonnet-4-6.

§max_tokens: Option<u64>

Maximum number of tokens to generate. Default: the model’s output ceiling from the shared model info when known, otherwise unset so Bedrock’s per-model default applies.

§temperature: Option<f64>

Controls randomness in generation.

§top_p: Option<f64>

Controls diversity via nucleus sampling.

§context_window_limit: Option<u64>

Context window size in tokens; filled from the shared model info when unset.

§model_info: Option<ModelInfo>

Overrides for what the SDK knows about the model.

§stop_sequences: Option<Vec<String>>

Sequences that stop generation.

§cache_config: Option<BedrockCacheConfig>

Prompt caching. Unset, no cache points are added.

§additional_request_fields: Option<JsonValue>

Extra fields for the model (additionalModelRequestFields), such as a thinking config.

§additional_response_field_paths: Option<Vec<String>>

Paths of extra response fields to return (additionalModelResponseFieldPaths).

§additional_args: Option<JsonValue>

Extra top-level Converse request fields, merged over the formatted request (for example requestMetadata, performanceConfig, serviceTier or promptVariables). Keys the Converse API does not define are ignored with a warning.

§stream: Option<bool>

Use ConverseStream (true, the default) or Converse (false).

§include_tool_result_status: Option<IncludeToolResultStatus>

Whether tool results carry their status. Default IncludeToolResultStatus::Auto.

§guardrail_config: Option<BedrockGuardrailConfig>

Guardrail configuration.

§use_native_token_count: Option<bool>

Count tokens with the Bedrock CountTokens API instead of the heuristic estimate. Default false.

§strict_tools: Option<bool>

Send every tool with strict: true and a closed copy of its input schema, constraining the model to schema-valid tool calls. Bedrock rejects schemas outside its strict subset. Turns deferred tool loading off, so Offload::defer and the deferredToolLoading preset send every full spec; a model_info override of deferred_tool_loading still wins. Default false.

Implementations§

Source§

impl BedrockModelConfig

Source

pub fn builder() -> BedrockModelConfigBuilder

Create an instance of BedrockModelConfig using the builder syntax

Source§

impl BedrockModelConfig

Source

pub fn merge(&mut self, update: Self)

Shallow-merges update into self: every field update sets replaces the current value.

Source

pub fn to_base(&self) -> BaseModelConfig

The BaseModelConfig fields of this configuration.

Trait Implementations§

Source§

impl Clone for BedrockModelConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BedrockModelConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BedrockModelConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<BaseModelConfig> for BedrockModelConfig

Source§

fn from(base: BaseModelConfig) -> Self

Converts to this type from the input type.
Source§

impl From<BedrockModelConfig> for BedrockModelOptions

Source§

fn from(config: BedrockModelConfig) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BedrockModelConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BedrockModelConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more