AWS bedrock-agentcore documentation change
Summary
Added Python code example demonstrating how to use the GetEvent API with boto3 client
Security assessment
This change adds a practical code example for using the GetEvent API but contains no security-related content, vulnerability fixes, or security feature documentation. It's a routine documentation improvement.
Diff
diff --git a/bedrock-agentcore/latest/devguide/short-term-get-event.md b/bedrock-agentcore/latest/devguide/short-term-get-event.md index 69a1e4e2c..32abda76b 100644 --- a//bedrock-agentcore/latest/devguide/short-term-get-event.md +++ b//bedrock-agentcore/latest/devguide/short-term-get-event.md @@ -7 +7,18 @@ -[GetEvent](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetEvent.html) API is an operation that retrieves a specific raw event by its identifier from short-term memory in AgentCore Memory. This API requires you to specify the `memoryId`, `actorId`, `sessionId`, and `eventId` as path parameters in the request URL to target your events based on above filters. +The [GetEvent](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetEvent.html) API retrieves a specific raw event by its identifier from short-term memory in AgentCore Memory. This API requires you to specify the `memoryId`, `actorId`, `sessionId`, and `eventId` as path parameters in the request URL. + + + import boto3 + + data_client = boto3.client('bedrock-agentcore') + + response = data_client.get_event( + memoryId="your-memory-id", + actorId="your-actor-id", + sessionId="your-session-id", + eventId="your-event-id" + ) + + event = response['event'] + print(f"Event ID: {event['eventId']}") + print(f"Timestamp: {event['eventTimestamp']}") + print(f"Payload: {event['payload']}")