Interface ConverseStreamRequest.Builder
- All Superinterfaces:
AwsRequest.Builder,BedrockRuntimeRequest.Builder,Buildable,CopyableBuilder<ConverseStreamRequest.Builder,,ConverseStreamRequest> SdkBuilder<ConverseStreamRequest.Builder,,ConverseStreamRequest> SdkPojo,SdkRequest.Builder
- Enclosing class:
ConverseStreamRequest
-
Method Summary
Modifier and TypeMethodDescriptionadditionalModelRequestFields(Document additionalModelRequestFields) Additional inference parameters that the model supports, beyond the base set of inference parameters thatConverseandConverseStreamsupport in theinferenceConfigfield.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 ConverseStreamRequest.BuilderguardrailConfig(Consumer<GuardrailStreamConfiguration.Builder> guardrailConfig) Configuration information for a guardrail that you want to use in the request.guardrailConfig(GuardrailStreamConfiguration guardrailConfig) Configuration information for a guardrail that you want to use in the request.default ConverseStreamRequest.BuilderinferenceConfig(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.Specifies the model or throughput with which to run inference, or the prompt resource to use in inference.overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Add an optional request override configuration.overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) Add an optional request override configuration.default ConverseStreamRequest.BuilderperformanceConfig(Consumer<PerformanceConfiguration.Builder> performanceConfig) Model performance settings for the request.performanceConfig(PerformanceConfiguration performanceConfig) Model performance settings for the request.promptVariables(Map<String, PromptVariableValues> promptVariables) Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation.requestMetadata(Map<String, String> requestMetadata) Key-value pairs that you can use to filter invocation logs.system(Collection<SystemContentBlock> system) A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.system(Consumer<SystemContentBlock.Builder>... system) A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.system(SystemContentBlock... system) A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.default ConverseStreamRequest.BuildertoolConfig(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
overrideConfigurationMethods inherited from interface software.amazon.awssdk.services.bedrockruntime.model.BedrockRuntimeRequest.Builder
buildMethods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copyMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, buildMethods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
-
Method Details
-
modelId
Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource 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 an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see Supported Regions and models for cross-region inference 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.
-
To include a prompt that was defined in Prompt management, specify the ARN of the prompt version to use.
The Converse API doesn't support imported models.
- Parameters:
modelId- Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource 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 an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see Supported Regions and models for cross-region inference 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.
-
To include a prompt that was defined in Prompt management, specify the ARN of the prompt version to use.
The Converse API doesn't support imported models.
-
- 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.Builderavoiding the need to create one manually viaMessage.builder().When the
Consumercompletes,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 prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.
- Parameters:
system- A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
system
A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.
- Parameters:
system- A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
system
A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.
This is a convenience method that creates an instance of theSystemContentBlock.Builderavoiding the need to create one manually viaSystemContentBlock.builder().When the
Consumercompletes,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.
ConverseandConverseStreamsupport a base set of inference parameters. If you need to pass additional parameters that the model supports, use theadditionalModelRequestFieldsrequest field.- Parameters:
inferenceConfig- Inference parameters to pass to the model.ConverseandConverseStreamsupport a base set of inference parameters. If you need to pass additional parameters that the model supports, use theadditionalModelRequestFieldsrequest field.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
inferenceConfig
default ConverseStreamRequest.Builder inferenceConfig(Consumer<InferenceConfiguration.Builder> inferenceConfig) Inference parameters to pass to the model.
This is a convenience method that creates an instance of theConverseandConverseStreamsupport a base set of inference parameters. If you need to pass additional parameters that the model supports, use theadditionalModelRequestFieldsrequest field.InferenceConfiguration.Builderavoiding the need to create one manually viaInferenceConfiguration.builder().When the
Consumercompletes,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.
For information about models that support streaming tool use, see Supported models and model features.
- Parameters:
toolConfig- Configuration information for the tools that the model can use when generating a response.For information about models that support streaming tool use, see Supported models and model features.
- 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.
For information about models that support streaming tool use, see Supported models and model features.
This is a convenience method that creates an instance of theToolConfiguration.Builderavoiding the need to create one manually viaToolConfiguration.builder().When the
Consumercompletes,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. If you include
guardContentblocks in thecontentfield in themessagesfield, the guardrail operates only on those messages. If you include noguardContentblocks, the guardrail operates on all messages in the request body and in any included prompt resource.- Parameters:
guardrailConfig- Configuration information for a guardrail that you want to use in the request. If you includeguardContentblocks in thecontentfield in themessagesfield, the guardrail operates only on those messages. If you include noguardContentblocks, the guardrail operates on all messages in the request body and in any included prompt resource.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
guardrailConfig
default ConverseStreamRequest.Builder guardrailConfig(Consumer<GuardrailStreamConfiguration.Builder> guardrailConfig) Configuration information for a guardrail that you want to use in the request. If you include
This is a convenience method that creates an instance of theguardContentblocks in thecontentfield in themessagesfield, the guardrail operates only on those messages. If you include noguardContentblocks, the guardrail operates on all messages in the request body and in any included prompt resource.GuardrailStreamConfiguration.Builderavoiding the need to create one manually viaGuardrailStreamConfiguration.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed toguardrailConfig(GuardrailStreamConfiguration).- Parameters:
guardrailConfig- a consumer that will call methods onGuardrailStreamConfiguration.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
ConverseandConverseStreamsupport in theinferenceConfigfield. For more information, see Model parameters.- Parameters:
additionalModelRequestFields- Additional inference parameters that the model supports, beyond the base set of inference parameters thatConverseandConverseStreamsupport in theinferenceConfigfield. For more information, see Model parameters.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
promptVariables
Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the
modelIdfield.- Parameters:
promptVariables- Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in themodelIdfield.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
additionalModelResponseFieldPaths
ConverseStreamRequest.Builder additionalModelResponseFieldPaths(Collection<String> additionalModelResponseFieldPaths) Additional model parameters field paths to return in the response.
ConverseandConverseStreamreturn the requested fields as a JSON Pointer object in theadditionalModelResponseFieldsfield. The following is example JSON foradditionalModelResponseFieldPaths.[ "/stop_sequence" ]For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
ConverseandConverseStreamreject an empty JSON Pointer or incorrectly structured JSON Pointer with a400error 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.ConverseandConverseStreamreturn the requested fields as a JSON Pointer object in theadditionalModelResponseFieldsfield. The following is example JSON foradditionalModelResponseFieldPaths.[ "/stop_sequence" ]For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
ConverseandConverseStreamreject an empty JSON Pointer or incorrectly structured JSON Pointer with a400error 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
ConverseStreamRequest.Builder additionalModelResponseFieldPaths(String... additionalModelResponseFieldPaths) Additional model parameters field paths to return in the response.
ConverseandConverseStreamreturn the requested fields as a JSON Pointer object in theadditionalModelResponseFieldsfield. The following is example JSON foradditionalModelResponseFieldPaths.[ "/stop_sequence" ]For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
ConverseandConverseStreamreject an empty JSON Pointer or incorrectly structured JSON Pointer with a400error 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.ConverseandConverseStreamreturn the requested fields as a JSON Pointer object in theadditionalModelResponseFieldsfield. The following is example JSON foradditionalModelResponseFieldPaths.[ "/stop_sequence" ]For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
ConverseandConverseStreamreject an empty JSON Pointer or incorrectly structured JSON Pointer with a400error 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.
-
requestMetadata
Key-value pairs that you can use to filter invocation logs.
- Parameters:
requestMetadata- Key-value pairs that you can use to filter invocation logs.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
performanceConfig
Model performance settings for the request.
- Parameters:
performanceConfig- Model performance settings for the request.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
performanceConfig
default ConverseStreamRequest.Builder performanceConfig(Consumer<PerformanceConfiguration.Builder> performanceConfig) Model performance settings for the request.
This is a convenience method that creates an instance of thePerformanceConfiguration.Builderavoiding the need to create one manually viaPerformanceConfiguration.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed toperformanceConfig(PerformanceConfiguration).- Parameters:
performanceConfig- a consumer that will call methods onPerformanceConfiguration.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
overrideConfiguration
ConverseStreamRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) Description copied from interface:AwsRequest.BuilderAdd an optional request override configuration.- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder- Parameters:
overrideConfiguration- The override configuration.- Returns:
- This object for method chaining.
-
overrideConfiguration
ConverseStreamRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Description copied from interface:AwsRequest.BuilderAdd an optional request override configuration.- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder- Parameters:
builderConsumer- AConsumerto which an emptyAwsRequestOverrideConfiguration.Builderwill be given.- Returns:
- This object for method chaining.
-