Interface RetrieveAndGenerateResponse.Builder
-
- All Superinterfaces:
AwsResponse.Builder,BedrockAgentRuntimeResponse.Builder,Buildable,CopyableBuilder<RetrieveAndGenerateResponse.Builder,RetrieveAndGenerateResponse>,SdkBuilder<RetrieveAndGenerateResponse.Builder,RetrieveAndGenerateResponse>,SdkPojo,SdkResponse.Builder
- Enclosing class:
- RetrieveAndGenerateResponse
@Mutable @NotThreadSafe public static interface RetrieveAndGenerateResponse.Builder extends BedrockAgentRuntimeResponse.Builder, SdkPojo, CopyableBuilder<RetrieveAndGenerateResponse.Builder,RetrieveAndGenerateResponse>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RetrieveAndGenerateResponse.Buildercitations(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.RetrieveAndGenerateResponse.Buildercitations(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.RetrieveAndGenerateResponse.Buildercitations(Citation... citations)A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.RetrieveAndGenerateResponse.BuilderguardrailAction(String guardrailAction)Specifies if there is a guardrail intervention in the response.RetrieveAndGenerateResponse.BuilderguardrailAction(GuadrailAction guardrailAction)Specifies if there is a guardrail intervention in the response.default RetrieveAndGenerateResponse.Builderoutput(Consumer<RetrieveAndGenerateOutput.Builder> output)Contains the response generated from querying the knowledge base.RetrieveAndGenerateResponse.Builderoutput(RetrieveAndGenerateOutput output)Contains the response generated from querying the knowledge base.RetrieveAndGenerateResponse.BuildersessionId(String sessionId)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 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 theCitation.Builderavoiding the need to create one manually viaCitation.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed to#citations(List.) - 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:
#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.
-
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.Builderavoiding the need to create one manually viaRetrieveAndGenerateOutput.builder().When the
Consumercompletes,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:
output(RetrieveAndGenerateOutput)
-
sessionId
RetrieveAndGenerateResponse.Builder sessionId(String sessionId)
The unique identifier of the session. When you first make a
RetrieveAndGeneraterequest, 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 thesessionIdyourself.- Parameters:
sessionId- The unique identifier of the session. When you first make aRetrieveAndGeneraterequest, 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 thesessionIdyourself.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-