具有工作階段屬性的範例請求 - Amazon Lex

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

具有工作階段屬性的範例請求

下列範例示範如何叫用 AMAZON.BedrockAgentIntent,並示範在回應中填入的工作階段和請求屬性。這些屬性包含 Bedrock 代理程式的回應資料,可用於存取代理程式的輸出、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 知識庫查詢詳細資訊。