View a markdown version of this page

取得事件 - Amazon Bedrock AgentCore

取得事件

GetEvent API 會透過其識別符從 AgentCore 記憶體中的短期記憶體擷取特定原始事件。此 API 會要求您在請求 URL actorId 中指定 memoryId 、、 sessionIdeventId做為路徑參數。

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']}")