翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
セッションから会話履歴とコンテキストを取得する
セッションの詳細、さまざまなチェックポイントでのインタラクション状態の詳細、すべての呼び出しの概要情報を取得するには、GetSession API オペレーション、ListInvocations API オペレーション、GetInvocationStep API オペレーションを使用します。
次のコード例は、AWS SDK for Python (Boto3) と GetInvocationStep API オペレーションを使用して、チェックポイントのテキストデータとイメージデータを取得する方法を説明しています。
def get_invocation_step(invocation_identifier, session_identifier, invocation_step_identifier): try: response = client.get_invocation_step( sessionIdentifier=session_identifier, invocationIdentifier=invocation_identifier, invocationStepId=invocation_step_identifier ) ["invocationStep"]["payload"]["contentBlocks"] print(response) except ClientError as e: print(f"Error: {e}")