Skip to content

Commit

Permalink
added support for sessionState in Agents for Amazon Bedrock
Browse files Browse the repository at this point in the history
  • Loading branch information
brnaba-aws committed Nov 20, 2024
1 parent f93fa68 commit 3156653
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ async def process_request(
:param additional_params: Optional additional parameters as key-value pairs.
:return: A ConversationMessage object containing the agent's response.
"""

session_state = {}
if (additional_params and 'sessionState' in additional_params):
session_state = additional_params['sessionState']
try:
print(session_state)
response = self.client.invoke_agent(
agentId=self.agent_id,
agentAliasId=self.agent_alias_id,
sessionId=session_id,
inputText=input_text
inputText=input_text,
sessionState=session_state
)

completion = ""
Expand Down

0 comments on commit 3156653

Please sign in to comment.