Select Language:
Currently, there’s no simple setting or option in the Amazon Bedrock RetrieveAndGenerate API to exclude the citations JSON array from responses. The system is built to include citations to help acknowledge the sources of the information it provides.
In fact, getting citations to show up consistently is often challenging for users. Sometimes citations appear, and other times they don’t, depending on how the model processes the information during each request.
If you want more control over the format of your response, here are a few strategies you can try:
First, you could split the process into two steps. Start by using the Retrieve API to gather relevant information chunks. Then, send those chunks separately to the model for response generation. This approach can help you better manage the format and content of the final answer.
Second, consider using the Converse API with a custom tool configuration. This allows you to define a specific JSON schema for the response, giving you more control over how the output looks and what parts it includes.
Third, you can add a post-processing step in your application. After receiving the response, you can filter or remove the citations array if it’s present in the reply.
It’s important to note that there’s no straightforward parameter in the RetrieveAndGenerate API to tell it “don’t include citations.” So, applying one of these methods is your best bet to customize your responses.
For more details and support, you might want to check out related resources like AWS Re:Post discussions, which cover topics such as handling limited references or adjusting response formats in Bedrock.