Simplest possible example using agentcore
This commit is contained in:
3
examples/aws-agentcore/.gitignore
vendored
Normal file
3
examples/aws-agentcore/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.bedrock_agentcore.yaml
|
||||||
|
.dockerignore
|
||||||
|
.bedrock_agentcore
|
||||||
@@ -73,6 +73,13 @@ Run your bot on AgentCore Runtime.
|
|||||||
agentcore invoke '{"roomUrl": "https://<your-domain>.daily.co/<room-name>"}' # -a <agent_name> (if multiple agents configured)
|
agentcore invoke '{"roomUrl": "https://<your-domain>.daily.co/<room-name>"}' # -a <agent_name> (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://<your-domain>.daily.co/<room-name>"}'
|
||||||
|
```
|
||||||
|
|
||||||
## Observation
|
## Observation
|
||||||
|
|
||||||
Paste the log tailing command you received when deploying your bot to AgentCore Runtime. It should look something like:
|
Paste the log tailing command you received when deploying your bot to AgentCore Runtime. It should look something like:
|
||||||
|
|||||||
10
examples/aws-agentcore/bot_hellow.py
Normal file
10
examples/aws-agentcore/bot_hellow.py
Normal file
@@ -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()
|
||||||
Reference in New Issue
Block a user