generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 447
feat: add region-aware default model ID for Bedrock #835
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
Merged
afarntrog
merged 5 commits into
strands-agents:main
from
afarntrog:732_default_endpoint
Sep 10, 2025
Merged
feat: add region-aware default model ID for Bedrock #835
afarntrog
merged 5 commits into
strands-agents:main
from
afarntrog:732_default_endpoint
Sep 10, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Format default model ID with region prefix (us/eu/apac) - Add warning for unsupported regions when using default model - Preserve custom model_id without region formatting - Map 'ap' region prefix to 'apac' for inference endpoints - Update tests to handle formatted default model ID
zastrowm
requested changes
Sep 10, 2025
dbschmigelski
requested changes
Sep 10, 2025
- Rename get_model_prefix_with_warning to _get_default_model_with_warning for clarity - Add support for us-gov regions in default model selection - Implement override detection for DEFAULT_BEDROCK_MODEL_ID constant - Return early when custom model_id is provided in config - Fix typo: 'then' -> 'than' in comment - Add comprehensive test coverage for new functionality - Update existing tests to match new method signature
to some custom `model_id` thinking it'll be used automatically in the Bedrock init. Therefore, we should not modify/format it if it was changed. Use case 2) Customers are used to `DEFAULT_BEDROCK_MODEL_ID` being set to a valid model. And it's possibly they are therefore using It in their code to do things like dynamically set the model: `agent.model.set_config(model_id=DEFAULT_BEDROCK_MODEL_ID)` We therefore need to handle that assumption and keep the `DEFAULT_BEDROCK_MODEL_ID` as is: `"us.anthropic.claude-sonnet-4-20250514-v1:0"`
zastrowm
approved these changes
Sep 10, 2025
JackYPCOnline
approved these changes
Sep 10, 2025
dbschmigelski
approved these changes
Sep 10, 2025
This was referenced Sep 12, 2025
Open
This was referenced Sep 17, 2025
Closed
Unshure
pushed a commit
to Unshure/sdk-python
that referenced
this pull request
Sep 24, 2025
These changes introduce region-aware default model ID functionality for Bedrock, formatting based on region prefixes, warnings for unsupported regions, and preservation of custom model IDs. Comprehensive test coverage was added, and existing tests were updated. We also maintain compatibility for two key use cases: preserving customer-overridden model IDs and maintaining compatibility with existing DEFAULT_BEDROCK_MODEL_ID usage patterns.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Related Issues
#732 #804 #770
Documentation PR
Will create a separate pr for docs in the getting started example.
Type of Change
Bug fix
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepare
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.