-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add bedrock_service_tier setting to BedrockModelSettings
#3773
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
Kludex
merged 7 commits into
pydantic:main
from
lukekh:lukekh/bedrock-settings-service-tier
Dec 23, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
84d90d2
feat: add bedrock_service_tier setting to BedrockModelSettings
lukekh bf8aae2
Merge branch 'main' into lukekh/bedrock-settings-service-tier
lukekh 5075d5b
test: add tests
lukekh e3969d2
Merge branch 'main' into lukekh/bedrock-settings-service-tier
lukekh 80172aa
fix: move dependency out of root project.toml dev group and into pyda…
lukekh f286a22
Merge branch 'main' into lukekh/bedrock-settings-service-tier
lukekh e7ee858
merge
Kludex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
48 changes: 48 additions & 0 deletions
48
tests/models/cassettes/test_bedrock/test_bedrock_model_service_tier.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| interactions: | ||
| - request: | ||
| body: '{"messages": [{"role": "user", "content": [{"text": "What is the capital of France?"}]}], "system": [{"text": "You | ||
| are a helpful chatbot."}], "serviceTier": {"type": "default"}}' | ||
| headers: | ||
| amz-sdk-invocation-id: | ||
| - !!binary | | ||
| ZmZhYjMyZmItODRjOS00YWZjLWE4NTAtNTQ4OTUxMjI5NmU4 | ||
| amz-sdk-request: | ||
| - !!binary | | ||
| YXR0ZW1wdD0x | ||
| content-length: | ||
| - '178' | ||
| content-type: | ||
| - !!binary | | ||
| YXBwbGljYXRpb24vanNvbg== | ||
| method: POST | ||
| uri: https://bedrock-runtime.us-east-1.amazonaws.com/model/us.amazon.nova-micro-v1%3A0/converse | ||
| response: | ||
| headers: | ||
| connection: | ||
| - keep-alive | ||
| content-length: | ||
| - '206' | ||
| content-type: | ||
| - application/json | ||
| parsed_body: | ||
| metrics: | ||
| latencyMs: 159 | ||
| output: | ||
| message: | ||
| content: | ||
| - text: The capital of France is Paris. Paris is not only the capital city but also the most populous city in France, known for its significant cultural, | ||
| political, and economic influence both within the country and globally. It is famous for landmarks such as the Eiffel Tower, the Louvre Museum, | ||
| and the Notre-Dame Cathedral, among many other historical and architectural treasures. | ||
|
|
||
| role: assistant | ||
| stopReason: max_tokens | ||
| usage: | ||
| inputTokens: 13 | ||
| outputTokens: 5 | ||
| totalTokens: 18 | ||
| serviceTier: | ||
| type: flex | ||
| status: | ||
| code: 200 | ||
| message: OK | ||
| version: 1 | ||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
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.
Test cassette request mismatches test code service tier value
The test specifies
bedrock_service_tier={'type': 'flex'}but the cassette file shows"serviceTier": {"type": "default"}in the recorded request body. This mismatch means the test isn't validating what it claims to test. The cassette appears to have been recorded with a different value than what the test code now uses, making the test unreliable for catching regressions in thebedrock_service_tierfunctionality.Additional Locations (1)
tests/models/test_bedrock.py#L566-L567