

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

# 세션 속성이 있는 샘플 요청
<a name="bedrock-agent-intent-sample"></a>

다음 예제에서는 AMAZON.BedrockAgentIntent를 간접 호출하는 방법과 응답에 채워진 세션 및 요청 속성을 보여줍니다. 이러한 속성에는 Bedrock Agent의 응답 데이터가 포함되며 에이전트의 출력, Amazon Bedrock 지식 기반 소스 및 작업 그룹 간접 호출 세부 정보에 액세스하는 데 사용할 수 있습니다.

```
{
    "sessionId": "user-session-123",
    "messages": [{
        "content": "Your order #12345 is currently being processed and will ship within 2-3 business days. You will receive a tracking number via email once it ships.",
        "contentType": "PlainText"
    }],
    "sessionState": {
        "sessionAttributes": {
            "x-amz-lex:bedrock-agent-search-response": "Your order #12345 is currently being processed and will ship within 2-3 business days. You will receive a tracking number via email once it ships.",
            "x-amz-lex:bedrock-knowledge-base-search-response-source": "[{\"title\": \"Order Processing Guide\", \"uri\": \"s3://knowledge-base/orders/processing.pdf\", \"excerpt\": \"Standard orders typically ship within 2-3 business days...\"}]",
            "x-amz-lex:bedrock-agent-action-group-invocation-input": "{\"actionGroupName\": \"OrderLookup\", \"function\": \"getOrderStatus\", \"parameters\": {\"orderId\": \"12345\", \"customerId\": \"67890\"}}",
            "x-amz-lex:bedrock-agent-knowledge-base-lookup-input": "{\"knowledgeBaseId\": \"KB123456\", \"query\": \"order status processing time\", \"numberOfResults\": 3}"
        },
        "intent": {
            "name": "BedrockAgentIntent",
            "slots": {},
            "state": "Fulfilled",
            "confirmationState": "None"
        },
        "dialogAction": {
            "type": "ElicitIntent"
        }
    },
    "interpretations": [{
        "intent": {
            "name": "FallbackIntent",
            "slots": {}
        },
        "interpretationSource": "Lex"
    }],
    "requestAttributes": {
        "x-amz-lex:channels:platform": "Web",
        "x-amz-lex:accept-content-types": "PlainText",
        "x-amz-lex:bedrock-agent-search-response": "Your order #12345 is currently being processed and will ship within 2-3 business days. You will receive a tracking number via email once it ships.",
        "x-amz-lex:bedrock-knowledge-base-search-response-source": "[{\"title\": \"Order Processing Guide\", \"uri\": \"s3://knowledge-base/orders/processing.pdf\", \"excerpt\": \"Standard orders typically ship within 2-3 business days...\"}]",
        "x-amz-lex:bedrock-agent-action-group-invocation-input": "{\"actionGroupName\": \"OrderLookup\", \"function\": \"getOrderStatus\", \"parameters\": {\"orderId\": \"12345\", \"customerId\": \"67890\"}}",
        "x-amz-lex:bedrock-agent-knowledge-base-lookup-input": "{\"knowledgeBaseId\": \"KB123456\", \"query\": \"order status processing time\", \"numberOfResults\": 3}"
    }
}
```

이 예제에서 세션 속성은 BedrockAgentIntent가 에이전트의 답변, 사용된 Amazon Bedrock 지식 기반 소스, 작업 그룹 간접 호출, 응답을 생성하는 데 사용된 Amazon Bedrock 지식 기반 조회 세부 정보를 포함한 응답 데이터를 채우는 방법을 보여줍니다.