Struct BedrockBuilder
pub struct BedrockBuilder { /* private fields */ }Expand description
Typed builder for BedrockModelProvider.
alias is the only positional argument. Whether the built provider
probes ambient AWS credentials (BEDROCK_API_KEY env, then
AwsCredentials::from_env, then AwsCredentials::from_credential_process)
depends on whether Self::bearer_token was called: setting an
explicit token bypasses every probe, and specifically avoids
spawning the credential_process command from ~/.aws/config.
Leaving it unset lets build() walk the standard AWS resolution
chain — the shape long-standing callers rely on when they wire
Bedrock through the AWS environment.
Implementations§
Source§impl BedrockBuilder
impl BedrockBuilder
Sourcepub fn bearer_token(self, token: &str) -> BedrockBuilder
pub fn bearer_token(self, token: &str) -> BedrockBuilder
Set an explicit Bearer token. When set, Self::build uses it
directly and skips every AWS credential probe (including the
credential_process command that would otherwise spawn a shell).
Sourcepub fn max_tokens(self, max_tokens: u32) -> BedrockBuilder
pub fn max_tokens(self, max_tokens: u32) -> BedrockBuilder
Override the maximum output tokens for API requests. Defaults to
zeroclaw_api::model_provider::BASELINE_MAX_TOKENS when unset.
Sourcepub fn build(self) -> BedrockModelProvider
pub fn build(self) -> BedrockModelProvider
Finalize the provider synchronously.
If bearer_token was set, uses it as-is with no ambient probe.
Otherwise walks the standard chain (BEDROCK_API_KEY env →
AwsCredentials::from_env → AwsCredentials::from_credential_process),
which can spawn the credential_process command from
~/.aws/config. Use Self::build_async if you need the
IMDS-aware resolver (which requires an async context).
Sourcepub async fn build_async(self) -> BedrockModelProvider
pub async fn build_async(self) -> BedrockModelProvider
Finalize the provider through the async credential resolver
(which additionally probes EC2 IMDSv2). Same bearer-token
short-circuit as Self::build.
Auto Trait Implementations§
impl Freeze for BedrockBuilder
impl RefUnwindSafe for BedrockBuilder
impl Send for BedrockBuilder
impl Sync for BedrockBuilder
impl Unpin for BedrockBuilder
impl UnsafeUnpin for BedrockBuilder
impl UnwindSafe for BedrockBuilder
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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