Interface RetrieveAndGenerateResponse.Builder

  • Method Details

    • citations

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

      Parameters:
      citations - A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

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

      Parameters:
      citations - A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

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

      This is a convenience method that creates an instance of the Citation.Builder avoiding the need to create one manually via Citation.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to citations(List<Citation>).

      Parameters:
      citations - a consumer that will call methods on Citation.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • guardrailAction

      RetrieveAndGenerateResponse.Builder guardrailAction(String guardrailAction)

      Specifies if there is a guardrail intervention in the response.

      Parameters:
      guardrailAction - Specifies if there is a guardrail intervention in the response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • guardrailAction

      RetrieveAndGenerateResponse.Builder guardrailAction(GuadrailAction guardrailAction)

      Specifies if there is a guardrail intervention in the response.

      Parameters:
      guardrailAction - Specifies if there is a guardrail intervention in the response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • output

      Contains the response generated from querying the knowledge base.

      Parameters:
      output - Contains the response generated from querying the knowledge base.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • output

      Contains the response generated from querying the knowledge base.

      This is a convenience method that creates an instance of the RetrieveAndGenerateOutput.Builder avoiding the need to create one manually via RetrieveAndGenerateOutput.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to output(RetrieveAndGenerateOutput).

      Parameters:
      output - a consumer that will call methods on RetrieveAndGenerateOutput.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • 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.

      Parameters:
      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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.