-
Notifications
You must be signed in to change notification settings - Fork 308
feat: added endpoint_url to amazon bedrock #2555
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 1 commit
2b1ebeb
e6e6ddd
8dc4cbc
158981e
a313e28
47a27d1
eef2794
be5812c
3fd5a58
8166059
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 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -592,7 +592,7 @@ impl AwsClient { | |||||||||||||||||||
let config = loader.load().await; | ||||||||||||||||||||
let http_client = custom_http_client::client()?; | ||||||||||||||||||||
|
||||||||||||||||||||
let bedrock_config = aws_sdk_bedrockruntime::config::Builder::from(&config) | ||||||||||||||||||||
let mut bedrock_config = aws_sdk_bedrockruntime::config::Builder::from(&config) | ||||||||||||||||||||
// To support HTTPS_PROXY https://github.com/awslabs/aws-sdk-rust/issues/169 | ||||||||||||||||||||
.http_client(http_client) | ||||||||||||||||||||
// Adding a custom http client (above) breaks the stalled stream protection for some reason. If a bedrock request takes longer than 5s (the default grace period, it makes it error out), so we disable it. | ||||||||||||||||||||
|
@@ -601,9 +601,14 @@ impl AwsClient { | |||||||||||||||||||
call_stack, | ||||||||||||||||||||
http_request_id.clone(), | ||||||||||||||||||||
&self.properties, | ||||||||||||||||||||
)) | ||||||||||||||||||||
.build(); | ||||||||||||||||||||
Ok(BedrockRuntimeClient::from_conf(bedrock_config)) | ||||||||||||||||||||
)); | ||||||||||||||||||||
|
||||||||||||||||||||
// Set endpoint_url if specified | ||||||||||||||||||||
if let Some(endpoint_url) = self.properties.endpoint_url.as_ref() { | ||||||||||||||||||||
bedrock_config = bedrock_config.endpoint_url(endpoint_url); | ||||||||||||||||||||
} | ||||||||||||||||||||
Comment on lines
+607
to
+609
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correctness: 🤖 AI Agent Prompt for Cursor/Windsurf
📝 Committable Code Suggestion
Suggested change
|
||||||||||||||||||||
|
||||||||||||||||||||
Ok(BedrockRuntimeClient::from_conf(bedrock_config.build())) | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
async fn chat_anyhow(&self, response: &ConverseOutput) -> Result<String> { | ||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correctness:
endpoint_url
is resolved and passed asSome(url)
even if the resolved string is empty, which may cause downstream consumers to receive an invalid endpoint.🤖 AI Agent Prompt for Cursor/Windsurf
📝 Committable Code Suggestion