Skip to content

RetrieveAndGenerateResponse

Source code in docs_src/capo_bedrock_agent_runtime/types/retrieve_and_generate_response.py
class RetrieveAndGenerateResponse(TypedDict, closed=True):
    session_id: "capo_bedrock_agent_runtime.types.session_id.SessionId"
    """<p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> 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 <code>sessionId</code> yourself.</p>"""
    output: "capo_bedrock_agent_runtime.types.retrieve_and_generate_output.RetrieveAndGenerateOutput"
    """<p>Contains the response generated from querying the knowledge base.</p>"""
    citations: NotRequired["capo_bedrock_agent_runtime.types.citations.Citations"]
    """<p>A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.</p>"""
    guardrail_action: NotRequired[
        "capo_bedrock_agent_runtime.types.guadrail_action.GuadrailAction"
    ]
    """<p>Specifies if there is a guardrail intervention in the response.</p>"""

citations instance-attribute

citations: NotRequired[Citations]

A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.

guardrail_action instance-attribute

guardrail_action: NotRequired[GuadrailAction]

Specifies if there is a guardrail intervention in the response.

output instance-attribute

Contains the response generated from querying the knowledge base.

session_id instance-attribute

session_id: SessionId

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.