Interface RetrieveAndGenerateResponse.Builder

    • Method Detail

      • citations

        RetrieveAndGenerateResponse.Builder citations​(Collection<Citation> 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

        RetrieveAndGenerateResponse.Builder citations​(Citation... 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

        RetrieveAndGenerateResponse.Builder citations​(Consumer<Citation.Builder>... 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).

        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:
        #citations(java.util.Collection)
      • 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:
        GuadrailAction, GuadrailAction
      • 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:
        GuadrailAction, GuadrailAction
      • output

        RetrieveAndGenerateResponse.Builder output​(RetrieveAndGenerateOutput 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.
      • sessionId

        RetrieveAndGenerateResponse.Builder sessionId​(String sessionId)

        The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.

        Parameters:
        sessionId - The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.
        Returns:
        Returns a reference to this object so that method calls can be chained together.