Interface CountTokensRequest.Builder
- All Superinterfaces:
AwsRequest.Builder,BedrockRuntimeRequest.Builder,Buildable,CopyableBuilder<CountTokensRequest.Builder,,CountTokensRequest> SdkBuilder<CountTokensRequest.Builder,,CountTokensRequest> SdkPojo,SdkRequest.Builder
- Enclosing class:
CountTokensRequest
-
Method Summary
Modifier and TypeMethodDescriptiondefault CountTokensRequest.Builderinput(Consumer<CountTokensInput.Builder> input) The input for which to count tokens.input(CountTokensInput input) The input for which to count tokens.The unique identifier or ARN of the foundation model to use for token counting.overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Add an optional request override configuration.overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) Add an optional request override configuration.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
The unique identifier or ARN of the foundation model to use for token counting. Each model processes tokens differently, so the token count is specific to the model you specify.
- Parameters:
modelId- The unique identifier or ARN of the foundation model to use for token counting. Each model processes tokens differently, so the token count is specific to the model you specify.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
input
The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for an
InvokeModelorConverserequest:-
For
InvokeModelrequests, provide the request body in theinvokeModelfield -
For
Converserequests, provide the messages and system content in theconversefield
The input format must be compatible with the model specified in the
modelIdparameter.- Parameters:
input- The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for anInvokeModelorConverserequest:-
For
InvokeModelrequests, provide the request body in theinvokeModelfield -
For
Converserequests, provide the messages and system content in theconversefield
The input format must be compatible with the model specified in the
modelIdparameter.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
input
The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for an
InvokeModelorConverserequest:-
For
InvokeModelrequests, provide the request body in theinvokeModelfield -
For
Converserequests, provide the messages and system content in theconversefield
The input format must be compatible with the model specified in the
This is a convenience method that creates an instance of themodelIdparameter.CountTokensInput.Builderavoiding the need to create one manually viaCountTokensInput.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed toinput(CountTokensInput).- Parameters:
input- a consumer that will call methods onCountTokensInput.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
-
overrideConfiguration
CountTokensRequest.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
CountTokensRequest.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.
-