File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
aws_lambda_powertools/event_handler Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class BedrockResponse:
2626 Contains the response body, status code, content type, and optional attributes
2727 for session management and knowledge base configuration.
2828 """
29+
2930 def __init__ (
3031 self ,
3132 body : Any = None ,
@@ -42,23 +43,13 @@ def __init__(
4243 self .prompt_session_attributes = prompt_session_attributes
4344 self .knowledge_bases_configuration = knowledge_bases_configuration
4445
45- def to_dict (self ) -> dict [str , Any ]:
46- return {
47- "body" : self .body ,
48- "status_code" : self .status_code ,
49- "content_type" : self .content_type ,
50- "session_attributes" : self .session_attributes ,
51- "prompt_session_attributes" : self .prompt_session_attributes ,
52- "knowledge_bases_configuration" : self .knowledge_bases_configuration ,
53- }
54-
55-
5646class BedrockResponseBuilder (ResponseBuilder ):
5747 """
5848 Bedrock Response Builder. This builds the response dict to be returned by Lambda when using Bedrock Agents.
5949
6050 Since the payload format is different from the standard API Gateway Proxy event, we override the build method.
6151 """
52+
6253 @override
6354 def build (self , event : BedrockAgentEvent , * args ) -> dict [str , Any ]:
6455 self ._route (event , None )
You can’t perform that action at this time.
0 commit comments