Interface CountTokensRequest.Builder
-
- All Superinterfaces:
AwsRequest.Builder,BedrockRuntimeRequest.Builder,Buildable,CopyableBuilder<CountTokensRequest.Builder,CountTokensRequest>,SdkBuilder<CountTokensRequest.Builder,CountTokensRequest>,SdkPojo,SdkRequest.Builder
- Enclosing class:
- CountTokensRequest
@Mutable @NotThreadSafe public static interface CountTokensRequest.Builder extends BedrockRuntimeRequest.Builder, SdkPojo, CopyableBuilder<CountTokensRequest.Builder,CountTokensRequest>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CountTokensRequest.Builderinput(Consumer<CountTokensInput.Builder> input)The input for which to count tokens.CountTokensRequest.Builderinput(CountTokensInput input)The input for which to count tokens.CountTokensRequest.BuildermodelId(String modelId)The unique identifier or ARN of the foundation model to use for token counting.CountTokensRequest.BuilderoverrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)CountTokensRequest.BuilderoverrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)-
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 Detail
-
modelId
CountTokensRequest.Builder modelId(String 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
CountTokensRequest.Builder input(CountTokensInput 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
default CountTokensRequest.Builder input(Consumer<CountTokensInput.Builder> 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:
input(CountTokensInput)
-
-
overrideConfiguration
CountTokensRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder
-
overrideConfiguration
CountTokensRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)
- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder
-
-