Class CountTokensRequest
- java.lang.Object
-
- software.amazon.awssdk.core.SdkRequest
-
- software.amazon.awssdk.awscore.AwsRequest
-
- software.amazon.awssdk.services.bedrockruntime.model.BedrockRuntimeRequest
-
- software.amazon.awssdk.services.bedrockruntime.model.CountTokensRequest
-
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<CountTokensRequest.Builder,CountTokensRequest>
@Generated("software.amazon.awssdk:codegen") public final class CountTokensRequest extends BedrockRuntimeRequest implements ToCopyableBuilder<CountTokensRequest.Builder,CountTokensRequest>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCountTokensRequest.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CountTokensRequest.Builderbuilder()booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()CountTokensInputinput()The input for which to count tokens.StringmodelId()The unique identifier or ARN of the foundation model to use for token counting.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends CountTokensRequest.Builder>serializableBuilderClass()CountTokensRequest.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfiguration
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
modelId
public final 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.
- 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
public final 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.- 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
public CountTokensRequest.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<CountTokensRequest.Builder,CountTokensRequest>- Specified by:
toBuilderin classBedrockRuntimeRequest
-
builder
public static CountTokensRequest.Builder builder()
-
serializableBuilderClass
public static Class<? extends CountTokensRequest.Builder> serializableBuilderClass()
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classAwsRequest
-
equals
public final boolean equals(Object obj)
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String 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
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
- Overrides:
getValueForFieldin classSdkRequest
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-