feat(bedrock_agents): add optional fields to response payload
Issue number:
Summary
Changes
This PR introduces the new BedrockResponse class to support custom Amazon Bedrock Agent responses.
BedrockResponseclass with support for:- Session attributes
- Prompt session attributes
- Knowledge base configurations
- Type-safe implementation with proper validation
- Example showing how to use BedrockResponse with Bedrock Agents in the documentation
User experience
response = BedrockResponse(
body={"message": "Hello from Bedrock!"},
session_attributes={"user_id": "123"},
prompt_session_attributes={"context": "testing"},
knowledge_bases_configuration=[
{
"knowledgeBaseId": "kb-123",
"retrievalConfiguration": {
"vectorSearchConfiguration": {"numberOfResults": 3, "overrideSearchType": "HYBRID"},
},
},
],
)
Checklist
If your change doesn't seem to apply, please leave them unchecked.
- [x] Meet tenets criteria
- [x] I have performed a self-review of this change
- [x] Changes have been tested
- [x] Changes are documented
- [x] PR title follows conventional commit semantics
Is this a breaking change?
RFC issue number:
Checklist:
- [ ] Migration process documented
- [ ] Implement warnings (if it can live side by side)
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 96.12%. Comparing base (
8883b1e) to head (0d2921b). Report is 18 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #6336 +/- ##
========================================
Coverage 96.11% 96.12%
========================================
Files 253 253
Lines 12086 12104 +18
Branches 898 902 +4
========================================
+ Hits 11617 11635 +18
Misses 369 369
Partials 100 100
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Hey @dreamorosi, can you check this PR?
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code