Interface RetrieveAndGenerateResponse.Builder
- All Superinterfaces:
AwsResponse.Builder
,BedrockAgentRuntimeResponse.Builder
,Buildable
,CopyableBuilder<RetrieveAndGenerateResponse.Builder,
,RetrieveAndGenerateResponse> SdkBuilder<RetrieveAndGenerateResponse.Builder,
,RetrieveAndGenerateResponse> SdkPojo
,SdkResponse.Builder
- Enclosing class:
RetrieveAndGenerateResponse
-
Method Summary
Modifier and TypeMethodDescriptioncitations
(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.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.A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.guardrailAction
(String guardrailAction) Specifies if there is a guardrail intervention in the response.guardrailAction
(GuadrailAction guardrailAction) Specifies if there is a guardrail intervention in the response.Contains the response generated from querying the knowledge base.output
(RetrieveAndGenerateOutput output) Contains the response generated from querying the knowledge base.The unique identifier of the session.Methods inherited from interface software.amazon.awssdk.services.bedrockagentruntime.model.BedrockAgentRuntimeResponse.Builder
build, responseMetadata, responseMetadata
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
Methods inherited from interface software.amazon.awssdk.core.SdkResponse.Builder
sdkHttpResponse, sdkHttpResponse
-
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 theCitation.Builder
avoiding the need to create one manually viaCitation.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tocitations(List<Citation>)
.- Parameters:
citations
- a consumer that will call methods onCitation.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
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
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
default RetrieveAndGenerateResponse.Builder output(Consumer<RetrieveAndGenerateOutput.Builder> output) Contains the response generated from querying the knowledge base.
This is a convenience method that creates an instance of theRetrieveAndGenerateOutput.Builder
avoiding the need to create one manually viaRetrieveAndGenerateOutput.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tooutput(RetrieveAndGenerateOutput)
.- Parameters:
output
- a consumer that will call methods onRetrieveAndGenerateOutput.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 thesessionId
yourself.- Parameters:
sessionId
- The unique identifier of the session. When you first make aRetrieveAndGenerate
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 thesessionId
yourself.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-