スキップしてコンテンツを表示

Bedrock, Knowledge Base API - exclude JSON citations array

0

Hello,

For Bedrock, Knowledge Base, /retrieveAndGenerate API, is there an input configuration that should specify that the response should not contain the citations JSON array ?

Thank you,

質問済み 1年前248ビュー

1回答
0
承認された回答

There isn't a direct configuration option in the Amazon Bedrock RetrieveAndGenerate API to specifically exclude the citations JSON array from the response. The inclusion of citations in the response is actually a feature designed to provide attribution for information sourced from the knowledge base.

The challenge with citations is actually the opposite of what you're asking - many users struggle with getting citations to appear consistently in responses. Citations may sometimes appear and sometimes not, depending on how the model processes the information.

If you're looking to control the format of the response more precisely, you have a few options:

  1. You could separate the retrieve and generate steps by using the Retrieve API first to get relevant chunks, then passing these to a foundation model via a separate call where you have more control over the response format.

  2. You could use the Converse API with a toolConfig that defines a specific JSON schema for the response, which would give you more control over the structure of the output.

  3. You could implement post-processing in your application to filter out the citations array from the response if it's present.

However, there isn't a simple parameter or flag in the RetrieveAndGenerate API that allows you to specify "don't include citations" in the response.
Sources
Problems with limited answer references in the Bedrock knowledge base | AWS re:Post
aws bedrock-runtime converse or invoke to get response in a given JSON schema format | AWS re:Post
How to have a bedrock agent reliably include knowledge base citations in the final response of InvokeAgent for Agents for Amazon Bedrock Runtime? | AWS re:Post

回答済み 1年前

AWS
エキスパート

レビュー済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ