From 2ccc20c1166db86f063d92f012b9f8e954e4cc6b Mon Sep 17 00:00:00 2001 From: Thomas Yu Date: Thu, 23 May 2024 19:36:30 -0700 Subject: [PATCH] Update --- bedrock/invoke.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/bedrock/invoke.py b/bedrock/invoke.py index 94cadc08..9772a1cd 100644 --- a/bedrock/invoke.py +++ b/bedrock/invoke.py @@ -42,16 +42,15 @@ def invoke_agent(agents_runtime_client, agent_id, agent_alias_id, session_id, pr return completion -runtime_client=boto3.client( - service_name="bedrock-agent-runtime", region_name="us-east-1" -) - - -response = invoke_agent( - agents_runtime_client=runtime_client, - agent_id="7O1Q74HUYJ", - agent_alias_id="EGWXPZWTLS", - session_id=str(uuid.uuid1()), - prompt="give me some observations about NF1fl/fl;Dhh-Cre" -) -json.loads(response) +if __name__ == "__main__": + runtime_client = boto3.client( + service_name="bedrock-agent-runtime", region_name="us-east-1" + ) + response = invoke_agent( + agents_runtime_client=runtime_client, + agent_id="7O1Q74HUYJ", + agent_alias_id="EGWXPZWTLS", + session_id=str(uuid.uuid1()), + prompt="give me some observations about NF1fl/fl;Dhh-Cre" + ) + print(json.loads(response))