Skip to content

/AWS1/CL_BDZ=>RETRIEVEANDGENERATE()

About RetrieveAndGenerate

Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or inference profile. The response only cites sources that are relevant to the query.

Method Signature

IMPORTING

Required arguments:

IO_INPUT TYPE REF TO /AWS1/CL_BDZRETRIEVEANDGENER01 /AWS1/CL_BDZRETRIEVEANDGENER01

Contains the query to be made to the knowledge base.

Optional arguments:

IV_SESSIONID TYPE /AWS1/BDZSESSIONID /AWS1/BDZSESSIONID

The unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself.

IO_RETRIEVEANDGENERATECONF TYPE REF TO /AWS1/CL_BDZRETRIEVEANDGENER02 /AWS1/CL_BDZRETRIEVEANDGENER02

Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.

IO_SESSIONCONFIGURATION TYPE REF TO /AWS1/CL_BDZRETRIEVEANDGENER03 /AWS1/CL_BDZRETRIEVEANDGENER03

Contains details about the session with the knowledge base.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_BDZRETRIEVEANDGENER04 /AWS1/CL_BDZRETRIEVEANDGENER04