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.Builder
input
(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
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, 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
InvokeModel
orConverse
request:-
For
InvokeModel
requests, provide the request body in theinvokeModel
field -
For
Converse
requests, provide the messages and system content in theconverse
field
The input format must be compatible with the model specified in the
modelId
parameter.- Parameters:
input
- The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for anInvokeModel
orConverse
request:-
For
InvokeModel
requests, provide the request body in theinvokeModel
field -
For
Converse
requests, provide the messages and system content in theconverse
field
The input format must be compatible with the model specified in the
modelId
parameter.-
- 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
InvokeModel
orConverse
request:-
For
InvokeModel
requests, provide the request body in theinvokeModel
field -
For
Converse
requests, provide the messages and system content in theconverse
field
The input format must be compatible with the model specified in the
This is a convenience method that creates an instance of themodelId
parameter.CountTokensInput.Builder
avoiding the need to create one manually viaCountTokensInput.builder()
.When the
Consumer
completes,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.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
CountTokensRequest.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.
-