View a markdown version of this page

获取活动 - Amazon Bedrock AgentCore
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

获取活动

GetEventAPI 通过其标识符从内存中的短期 AgentCore 内存中检索特定的原始事件。此 API 要求您在请求 URL 中将memoryIdactorIdsessionId、和指定eventId为路径参数。

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