Interface ConverseRequest.Builder
- All Superinterfaces:
AwsRequest.Builder
,BedrockRuntimeRequest.Builder
,Buildable
,CopyableBuilder<ConverseRequest.Builder,
,ConverseRequest> SdkBuilder<ConverseRequest.Builder,
,ConverseRequest> SdkPojo
,SdkRequest.Builder
- Enclosing class:
ConverseRequest
-
Method Summary
Modifier and TypeMethodDescriptionadditionalModelRequestFields
(Document additionalModelRequestFields) Additional inference parameters that the model supports, beyond the base set of inference parameters thatConverse
supports in theinferenceConfig
field.additionalModelResponseFieldPaths
(String... additionalModelResponseFieldPaths) Additional model parameters field paths to return in the response.additionalModelResponseFieldPaths
(Collection<String> additionalModelResponseFieldPaths) Additional model parameters field paths to return in the response.default ConverseRequest.Builder
guardrailConfig
(Consumer<GuardrailConfiguration.Builder> guardrailConfig) Configuration information for a guardrail that you want to use in the request.guardrailConfig
(GuardrailConfiguration guardrailConfig) Configuration information for a guardrail that you want to use in the request.default ConverseRequest.Builder
inferenceConfig
(Consumer<InferenceConfiguration.Builder> inferenceConfig) Inference parameters to pass to the model.inferenceConfig
(InferenceConfiguration inferenceConfig) Inference parameters to pass to the model.messages
(Collection<Message> messages) The messages that you want to send to the model.messages
(Consumer<Message.Builder>... messages) The messages that you want to send to the model.The messages that you want to send to the model.The identifier for the model that you want to call.overrideConfiguration
(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Add an optional request override configuration.overrideConfiguration
(AwsRequestOverrideConfiguration overrideConfiguration) Add an optional request override configuration.system
(Collection<SystemContentBlock> system) A system prompt to pass to the model.system
(Consumer<SystemContentBlock.Builder>... system) A system prompt to pass to the model.system
(SystemContentBlock... system) A system prompt to pass to the model.default ConverseRequest.Builder
toolConfig
(Consumer<ToolConfiguration.Builder> toolConfig) Configuration information for the tools that the model can use when generating a response.toolConfig
(ToolConfiguration toolConfig) Configuration information for the tools that the model can use when generating a response.Methods inherited from interface software.amazon.awssdk.awscore.AwsRequest.Builder
overrideConfiguration
Methods inherited from interface software.amazon.awssdk.services.bedrockruntime.model.BedrockRuntimeRequest.Builder
build
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
-
Method Details
-
modelId
The identifier for the model that you want to call.
The
modelId
to provide depends on the type of model that you use:-
If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide.
-
If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide.
-
If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide.
- Parameters:
modelId
- The identifier for the model that you want to call.The
modelId
to provide depends on the type of model that you use:-
If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide.
-
If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide.
-
If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
messages
The messages that you want to send to the model.
- Parameters:
messages
- The messages that you want to send to the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
messages
The messages that you want to send to the model.
- Parameters:
messages
- The messages that you want to send to the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
messages
The messages that you want to send to the model.
This is a convenience method that creates an instance of theMessage.Builder
avoiding the need to create one manually viaMessage.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tomessages(List<Message>)
.- Parameters:
messages
- a consumer that will call methods onMessage.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
system
A system prompt to pass to the model.
- Parameters:
system
- A system prompt to pass to the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
system
A system prompt to pass to the model.
- Parameters:
system
- A system prompt to pass to the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
system
A system prompt to pass to the model.
This is a convenience method that creates an instance of theSystemContentBlock.Builder
avoiding the need to create one manually viaSystemContentBlock.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tosystem(List<SystemContentBlock>)
.- Parameters:
system
- a consumer that will call methods onSystemContentBlock.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
inferenceConfig
Inference parameters to pass to the model.
Converse
supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use theadditionalModelRequestFields
request field.- Parameters:
inferenceConfig
- Inference parameters to pass to the model.Converse
supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use theadditionalModelRequestFields
request field.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
inferenceConfig
default ConverseRequest.Builder inferenceConfig(Consumer<InferenceConfiguration.Builder> inferenceConfig) Inference parameters to pass to the model.
This is a convenience method that creates an instance of theConverse
supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use theadditionalModelRequestFields
request field.InferenceConfiguration.Builder
avoiding the need to create one manually viaInferenceConfiguration.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toinferenceConfig(InferenceConfiguration)
.- Parameters:
inferenceConfig
- a consumer that will call methods onInferenceConfiguration.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
toolConfig
Configuration information for the tools that the model can use when generating a response.
This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
- Parameters:
toolConfig
- Configuration information for the tools that the model can use when generating a response.This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toolConfig
Configuration information for the tools that the model can use when generating a response.
This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
ToolConfiguration.Builder
avoiding the need to create one manually viaToolConfiguration.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed totoolConfig(ToolConfiguration)
.- Parameters:
toolConfig
- a consumer that will call methods onToolConfiguration.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
guardrailConfig
Configuration information for a guardrail that you want to use in the request.
- Parameters:
guardrailConfig
- Configuration information for a guardrail that you want to use in the request.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
guardrailConfig
default ConverseRequest.Builder guardrailConfig(Consumer<GuardrailConfiguration.Builder> guardrailConfig) Configuration information for a guardrail that you want to use in the request.
This is a convenience method that creates an instance of theGuardrailConfiguration.Builder
avoiding the need to create one manually viaGuardrailConfiguration.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toguardrailConfig(GuardrailConfiguration)
.- Parameters:
guardrailConfig
- a consumer that will call methods onGuardrailConfiguration.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
additionalModelRequestFields
Additional inference parameters that the model supports, beyond the base set of inference parameters that
Converse
supports in theinferenceConfig
field. For more information, see Model parameters.- Parameters:
additionalModelRequestFields
- Additional inference parameters that the model supports, beyond the base set of inference parameters thatConverse
supports in theinferenceConfig
field. For more information, see Model parameters.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
additionalModelResponseFieldPaths
ConverseRequest.Builder additionalModelResponseFieldPaths(Collection<String> additionalModelResponseFieldPaths) Additional model parameters field paths to return in the response.
Converse
returns the requested fields as a JSON Pointer object in theadditionalModelResponseFields
field. The following is example JSON foradditionalModelResponseFieldPaths
.[ "/stop_sequence" ]
For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
Converse
rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a400
error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored byConverse
.- Parameters:
additionalModelResponseFieldPaths
- Additional model parameters field paths to return in the response.Converse
returns the requested fields as a JSON Pointer object in theadditionalModelResponseFields
field. The following is example JSON foradditionalModelResponseFieldPaths
.[ "/stop_sequence" ]
For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
Converse
rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a400
error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored byConverse
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
additionalModelResponseFieldPaths
ConverseRequest.Builder additionalModelResponseFieldPaths(String... additionalModelResponseFieldPaths) Additional model parameters field paths to return in the response.
Converse
returns the requested fields as a JSON Pointer object in theadditionalModelResponseFields
field. The following is example JSON foradditionalModelResponseFieldPaths
.[ "/stop_sequence" ]
For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
Converse
rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a400
error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored byConverse
.- Parameters:
additionalModelResponseFieldPaths
- Additional model parameters field paths to return in the response.Converse
returns the requested fields as a JSON Pointer object in theadditionalModelResponseFields
field. The following is example JSON foradditionalModelResponseFieldPaths
.[ "/stop_sequence" ]
For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
Converse
rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a400
error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored byConverse
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
overrideConfiguration
ConverseRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) Description copied from interface:AwsRequest.Builder
Add an optional request override configuration.- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
- Parameters:
overrideConfiguration
- The override configuration.- Returns:
- This object for method chaining.
-
overrideConfiguration
ConverseRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Description copied from interface:AwsRequest.Builder
Add an optional request override configuration.- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
- Parameters:
builderConsumer
- AConsumer
to which an emptyAwsRequestOverrideConfiguration.Builder
will be given.- Returns:
- This object for method chaining.
-