-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: bedrock creds refresh #5599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,8 +37,6 @@ pub const BEDROCK_DEFAULT_MAX_RETRY_INTERVAL_MS: u64 = 120_000; | |
|
|
||
| #[derive(Debug, serde::Serialize)] | ||
| pub struct BedrockProvider { | ||
| #[serde(skip)] | ||
| client: Client, | ||
| model: ModelConfig, | ||
| #[serde(skip)] | ||
| retry_config: RetryConfig, | ||
|
|
@@ -65,19 +63,15 @@ impl BedrockProvider { | |
| set_aws_env_vars(config.all_secrets()); | ||
|
|
||
| let sdk_config = aws_config::load_from_env().await; | ||
|
|
||
| // validate credentials or return error back up | ||
| sdk_config | ||
| .credentials_provider() | ||
| .unwrap() | ||
| .provide_credentials() | ||
| .await?; | ||
| let client = Client::new(&sdk_config); | ||
|
|
||
| let retry_config = Self::load_retry_config(config); | ||
|
|
||
| Ok(Self { | ||
| client, | ||
| model, | ||
| retry_config, | ||
| name: Self::metadata().name, | ||
|
|
@@ -117,8 +111,10 @@ impl BedrockProvider { | |
| ) -> Result<(bedrock::Message, Option<bedrock::TokenUsage>), ProviderError> { | ||
| let model_name = &self.model.model_name; | ||
|
|
||
| let mut request = self | ||
| .client | ||
| let sdk_config = aws_config::load_from_env().await; | ||
| let client = Client::new(&sdk_config); | ||
|
Comment on lines
+114
to
+115
|
||
|
|
||
| let mut request = client | ||
| .converse() | ||
| .system(bedrock::SystemContentBlock::Text(system.to_string())) | ||
| .model_id(model_name.to_string()) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.