pub struct BedrockConfig {
pub model_id: String,
pub region: Option<String>,
pub max_tokens: Option<i32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub stop: Option<Vec<String>>,
}Expand description
Configuration for the AWS Bedrock chat model.
Fields§
§model_id: StringThe model identifier (e.g., "anthropic.claude-3-5-sonnet-20241022-v2:0").
region: Option<String>AWS region override. Falls back to AWS_REGION env var or "us-east-1".
max_tokens: Option<i32>Maximum number of tokens to generate.
temperature: Option<f32>Sampling temperature (0.0 - 1.0).
top_p: Option<f32>Nucleus sampling parameter.
stop: Option<Vec<String>>Stop sequences.
Implementations§
Source§impl BedrockConfig
impl BedrockConfig
Sourcepub fn new(model_id: impl Into<String>) -> Self
pub fn new(model_id: impl Into<String>) -> Self
Create a new configuration with the given model ID.
Sourcepub fn with_region(self, region: impl Into<String>) -> Self
pub fn with_region(self, region: impl Into<String>) -> Self
Set the AWS region.
Sourcepub fn with_max_tokens(self, max_tokens: i32) -> Self
pub fn with_max_tokens(self, max_tokens: i32) -> Self
Set the maximum number of output tokens.
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Set the sampling temperature.
Sourcepub fn with_top_p(self, top_p: f32) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
Set the nucleus sampling parameter.
Trait Implementations§
Source§impl Clone for BedrockConfig
impl Clone for BedrockConfig
Source§fn clone(&self) -> BedrockConfig
fn clone(&self) -> BedrockConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BedrockConfig
impl RefUnwindSafe for BedrockConfig
impl Send for BedrockConfig
impl Sync for BedrockConfig
impl Unpin for BedrockConfig
impl UnsafeUnpin for BedrockConfig
impl UnwindSafe for BedrockConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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 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>
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 moreCreates a shared type from an unshared type.