Skip to content

Conversation

tkawa
Copy link

@tkawa tkawa commented Aug 15, 2025

Issue #, if available: N/A

Description of changes:

This pull request updates the construction of the Bedrock model ARN in builtin_tools/aws/tools/bedrock_retrieve.py (line 36) to use the region from bedrock_client instead of the previously hardcoded us-west-2.

When running in a region different from us-west-2, using a hardcoded region causes the error:
"Reranking does not support cross-region calls. Please provide a valid model ARN."

By dynamically using self.bedrock_client.meta.region_name for the ARN's region, the reranking operation will always use the same region as the client, preventing cross-region errors and improving compatibility across different AWS regions.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ybalbert001
Copy link
Contributor

The reason I hardcode 'us-west-2' here is because there are no available rerank model access in other region.

I guess the cross-region errors is new for us. Are you sure your change is ok for every region?

@tkawa
Copy link
Author

tkawa commented Aug 20, 2025

@ybalbert001
According to the following page, the rerank model is supported in some regions other than us-west-2.
https://docs.aws.amazon.com/bedrock/latest/userguide/rerank-supported.html

I am trying to use the bedrock knowledge base and rerank model in the ap-northeast-1 region.
This change will not make it work in all regions, but it is an improvement over the current situation, as reranking does not support cross-region calls in the first place.

@tkawa
Copy link
Author

tkawa commented Aug 26, 2025

@warren830
What do you think about this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants