Skip to content

Commit 5cba20a

Browse files
committed
remove unnecessary attributes and add docstrings
1 parent d5bd8dc commit 5cba20a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

aws_lambda_powertools/event_handler/bedrock_agent.py

+2-11
Original file line numberDiff line numberDiff 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-
5646
class 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)

0 commit comments

Comments
 (0)