

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 세션에서 대화 기록 및 컨텍스트 검색
<a name="sessions-retrieve-coversation"></a>

[GetSession](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetSession.html), [ListInvocations](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListInvocations.html) 및 [GetInvocationStep](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetInvocationStep.html) API 작업을 사용하여 세션 세부 정보, 다른 체크포인트의 상호 작용 상태에 대한 세부 정보 및 모든 간접 호출에 대한 요약 정보를 검색합니다.

다음 예제 코드는 AWS SDK for Python (Boto3) 및 [GetInvocationStep](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetInvocationStep.html) 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}")
```