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
impl BedrockModelConfig
Sourcepub fn builder() -> BedrockModelConfigBuilder
pub fn builder() -> BedrockModelConfigBuilder
Create an instance of BedrockModelConfig using the builder syntax
Source§impl BedrockModelConfig
impl BedrockModelConfig
Sourcepub fn merge(&mut self, update: Self)
pub fn merge(&mut self, update: Self)
Shallow-merges update into self: every field update sets replaces the current value.
Sourcepub fn to_base(&self) -> BaseModelConfig
pub fn to_base(&self) -> BaseModelConfig
The BaseModelConfig fields of this configuration.
Trait Implementations§
Source§impl Clone for BedrockModelConfig
impl Clone for BedrockModelConfig
Source§impl Debug for BedrockModelConfig
impl Debug for BedrockModelConfig
Source§impl Default for BedrockModelConfig
impl Default for BedrockModelConfig
Source§impl From<BaseModelConfig> for BedrockModelConfig
impl From<BaseModelConfig> for BedrockModelConfig
Source§fn from(base: BaseModelConfig) -> Self
fn from(base: BaseModelConfig) -> Self
Source§impl From<BedrockModelConfig> for BedrockModelOptions
impl From<BedrockModelConfig> for BedrockModelOptions
Source§fn from(config: BedrockModelConfig) -> Self
fn from(config: BedrockModelConfig) -> Self
Source§impl PartialEq for BedrockModelConfig
impl PartialEq for BedrockModelConfig
impl StructuralPartialEq for BedrockModelConfig
Auto Trait Implementations§
impl Freeze for BedrockModelConfig
impl RefUnwindSafe for BedrockModelConfig
impl Send for BedrockModelConfig
impl Sync for BedrockModelConfig
impl Unpin for BedrockModelConfig
impl UnsafeUnpin for BedrockModelConfig
impl UnwindSafe for BedrockModelConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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