Class CountTokensRequest
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<CountTokensRequest.Builder,CountTokensRequest>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CountTokensRequest.Builderbuilder()final booleanfinal booleanequalsBySdkFields(Object obj) final <T> Optional<T>getValueForField(String fieldName, Class<T> clazz) final inthashCode()final CountTokensInputinput()The input for which to count tokens.final StringmodelId()The unique identifier or ARN of the foundation model to use for token counting.static Class<? extends CountTokensRequest.Builder>final StringtoString()Returns a string representation of this object.Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfigurationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
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.
- Returns:
- 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.
-
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.- Returns:
- 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. -
-
-
toBuilder
- Specified by:
toBuilderin interfaceToCopyableBuilder<CountTokensRequest.Builder,CountTokensRequest> - Specified by:
toBuilderin classBedrockRuntimeRequest
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode()- Overrides:
hashCodein classAwsRequest
-
equals
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
- Overrides:
getValueForFieldin classSdkRequest
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-