Interface ConverseResponse.Builder
- All Superinterfaces:
AwsResponse.Builder
,BedrockRuntimeResponse.Builder
,Buildable
,CopyableBuilder<ConverseResponse.Builder,
,ConverseResponse> SdkBuilder<ConverseResponse.Builder,
,ConverseResponse> SdkPojo
,SdkResponse.Builder
- Enclosing class:
ConverseResponse
-
Method Summary
Modifier and TypeMethodDescriptionadditionalModelResponseFields
(Document additionalModelResponseFields) Additional fields in the response that are unique to the model.default ConverseResponse.Builder
metrics
(Consumer<ConverseMetrics.Builder> metrics) Metrics for the call toConverse
.metrics
(ConverseMetrics metrics) Metrics for the call toConverse
.default ConverseResponse.Builder
output
(Consumer<ConverseOutput.Builder> output) The result from the call toConverse
.output
(ConverseOutput output) The result from the call toConverse
.stopReason
(String stopReason) The reason why the model stopped generating output.stopReason
(StopReason stopReason) The reason why the model stopped generating output.default ConverseResponse.Builder
trace
(Consumer<ConverseTrace.Builder> trace) A trace object that contains information about the Guardrail behavior.trace
(ConverseTrace trace) A trace object that contains information about the Guardrail behavior.default ConverseResponse.Builder
usage
(Consumer<TokenUsage.Builder> usage) The total number of tokens used in the call toConverse
.usage
(TokenUsage usage) The total number of tokens used in the call toConverse
.Methods inherited from interface software.amazon.awssdk.services.bedrockruntime.model.BedrockRuntimeResponse.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, sdkFields
Methods inherited from interface software.amazon.awssdk.core.SdkResponse.Builder
sdkHttpResponse, sdkHttpResponse
-
Method Details
-
output
The result from the call to
Converse
.- Parameters:
output
- The result from the call toConverse
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
output
The result from the call to
This is a convenience method that creates an instance of theConverse
.ConverseOutput.Builder
avoiding the need to create one manually viaConverseOutput.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tooutput(ConverseOutput)
.- Parameters:
output
- a consumer that will call methods onConverseOutput.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
stopReason
The reason why the model stopped generating output.
- Parameters:
stopReason
- The reason why the model stopped generating output.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
stopReason
The reason why the model stopped generating output.
- Parameters:
stopReason
- The reason why the model stopped generating output.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
usage
The total number of tokens used in the call to
Converse
. The total includes the tokens input to the model and the tokens generated by the model.- Parameters:
usage
- The total number of tokens used in the call toConverse
. The total includes the tokens input to the model and the tokens generated by the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
usage
The total number of tokens used in the call to
This is a convenience method that creates an instance of theConverse
. The total includes the tokens input to the model and the tokens generated by the model.TokenUsage.Builder
avoiding the need to create one manually viaTokenUsage.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tousage(TokenUsage)
.- Parameters:
usage
- a consumer that will call methods onTokenUsage.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
metrics
Metrics for the call to
Converse
.- Parameters:
metrics
- Metrics for the call toConverse
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
metrics
Metrics for the call to
This is a convenience method that creates an instance of theConverse
.ConverseMetrics.Builder
avoiding the need to create one manually viaConverseMetrics.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tometrics(ConverseMetrics)
.- Parameters:
metrics
- a consumer that will call methods onConverseMetrics.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
additionalModelResponseFields
Additional fields in the response that are unique to the model.
- Parameters:
additionalModelResponseFields
- Additional fields in the response that are unique to the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
trace
A trace object that contains information about the Guardrail behavior.
- Parameters:
trace
- A trace object that contains information about the Guardrail behavior.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
trace
A trace object that contains information about the Guardrail behavior.
This is a convenience method that creates an instance of theConverseTrace.Builder
avoiding the need to create one manually viaConverseTrace.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed totrace(ConverseTrace)
.- Parameters:
trace
- a consumer that will call methods onConverseTrace.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-