将Kendra的FAQ URL添加到Lex响应中

0

【以下的问题经过翻译处理】 当您将FAQ上传到Kendra时,有三个值:Question, Answer, and URL。然而,Lex Responses的文档只显示如何返回Question 和Answer:

来源: https://docs.aws.amazon.com/lex/latest/dg/faq-bot-kendra-search.html

I found a FAQ question for you: ((x-amz-lex:kendra-search-response-question_answer-question-1)) and the answer is ((x-amz-lex:kendra-search-response-question_answer-answer-1)).

我如何访问与问题1和答案1相关联的URL?

有个类似的问题在下面的链接中提出,但回答不正确。 https://forums.aws.amazon.com/thread.jspa?threadID=336412

profile picture
专家
已提问 8 个月前50 查看次数
1 回答
0

【以下的回答经过翻译处理】 如果Kendra的查询结果类型为QUESTION_ANSWER,Kendra的QueryResultItem将不返回DocumentURI字段,因此Lex无法提供此值。

当Kendra的查询结果类型为另外两种时,即DOCUMENT和ANSWER类型,Kendra会返回DocumentURI,而Lex可以通过请求属性“x-amz-lex:kendra-search-response-document-link-<N>”来访问DOCUMENT类型结果的URI。

希望这可以帮助到您!

profile picture
专家
已回答 8 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则