From 625d56e8fae7ecbc7865a94d9d8b6720d1a1f843 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Thu, 27 Nov 2025 16:22:32 -0300 Subject: [PATCH] Simplest possible example using agentcore --- examples/aws-agentcore/.gitignore | 3 +++ examples/aws-agentcore/README.md | 7 +++++++ examples/aws-agentcore/bot_hellow.py | 10 ++++++++++ 3 files changed, 20 insertions(+) create mode 100644 examples/aws-agentcore/.gitignore create mode 100644 examples/aws-agentcore/bot_hellow.py diff --git a/examples/aws-agentcore/.gitignore b/examples/aws-agentcore/.gitignore new file mode 100644 index 000000000..2d2dea915 --- /dev/null +++ b/examples/aws-agentcore/.gitignore @@ -0,0 +1,3 @@ +.bedrock_agentcore.yaml +.dockerignore +.bedrock_agentcore \ No newline at end of file diff --git a/examples/aws-agentcore/README.md b/examples/aws-agentcore/README.md index 3bd1d26b4..3cd9be13a 100644 --- a/examples/aws-agentcore/README.md +++ b/examples/aws-agentcore/README.md @@ -73,6 +73,13 @@ Run your bot on AgentCore Runtime. agentcore invoke '{"roomUrl": "https://.daily.co/"}' # -a (if multiple agents configured) ``` +In case we wish to define the session-id, to create a new session each time we invoke: +```bash +aws-agentcore % agentcore invoke \ + --session-id user-123456-conversation-12345679 \ + '{"roomUrl": "https://.daily.co/"}' +``` + ## Observation Paste the log tailing command you received when deploying your bot to AgentCore Runtime. It should look something like: diff --git a/examples/aws-agentcore/bot_hellow.py b/examples/aws-agentcore/bot_hellow.py new file mode 100644 index 000000000..b4e599ae0 --- /dev/null +++ b/examples/aws-agentcore/bot_hellow.py @@ -0,0 +1,10 @@ +from bedrock_agentcore import BedrockAgentCoreApp + +app = BedrockAgentCoreApp() + +@app.entrypoint +def my_agent(payload): + return {"result": f"Hello {payload.get('name', 'World')}!"} + +if __name__ == "__main__": + app.run() \ No newline at end of file