跳至内容

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 年前254 查看次数

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 年前

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

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