amazon-bedrock

Can I query a knowledge base and generate a response WITH streaming using Bedrock?


I am successfully using RetrieveAndGenerate from bedrock, but is there an equivalent that would allow streaming? I would like to use websockets to render the characters one at a time to the user for a more pleasant experience.


Solution

  • Yes, you can by using RetrieveAndGenerateStream API. Amazon Bedrock Knowledge Bases now supports streaming responses