Class CountTokensInput
- java.lang.Object
-
- software.amazon.awssdk.services.bedrockruntime.model.CountTokensInput
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<CountTokensInput.Builder,CountTokensInput>
@Generated("software.amazon.awssdk:codegen") public final class CountTokensInput extends Object implements SdkPojo, Serializable, ToCopyableBuilder<CountTokensInput.Builder,CountTokensInput>
The input value for token counting. The value should be either an
InvokeModelorConverserequest body.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCountTokensInput.Builderstatic classCountTokensInput.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CountTokensInput.Builderbuilder()ConverseTokensRequestconverse()AConverserequest for which to count tokens.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)static CountTokensInputfromConverse(Consumer<ConverseTokensRequest.Builder> converse)Create an instance of this class withconverse()initialized to the given value.static CountTokensInputfromConverse(ConverseTokensRequest converse)Create an instance of this class withconverse()initialized to the given value.static CountTokensInputfromInvokeModel(Consumer<InvokeModelTokensRequest.Builder> invokeModel)Create an instance of this class withinvokeModel()initialized to the given value.static CountTokensInputfromInvokeModel(InvokeModelTokensRequest invokeModel)Create an instance of this class withinvokeModel()initialized to the given value.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()InvokeModelTokensRequestinvokeModel()AnInvokeModelrequest for which to count tokens.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends CountTokensInput.Builder>serializableBuilderClass()CountTokensInput.BuildertoBuilder()StringtoString()Returns a string representation of this object.CountTokensInput.Typetype()Retrieve an enum value representing which member of this object is populated.-
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
-
invokeModel
public final InvokeModelTokensRequest invokeModel()
An
InvokeModelrequest for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to theInvokeModeloperation.- Returns:
- An
InvokeModelrequest for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to theInvokeModeloperation.
-
converse
public final ConverseTokensRequest converse()
A
Converserequest for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to theConverseoperation.- Returns:
- A
Converserequest for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to theConverseoperation.
-
toBuilder
public CountTokensInput.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<CountTokensInput.Builder,CountTokensInput>
-
builder
public static CountTokensInput.Builder builder()
-
serializableBuilderClass
public static Class<? extends CountTokensInput.Builder> serializableBuilderClass()
-
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.
-
fromInvokeModel
public static CountTokensInput fromInvokeModel(InvokeModelTokensRequest invokeModel)
Create an instance of this class withinvokeModel()initialized to the given value.An
InvokeModelrequest for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to theInvokeModeloperation.- Parameters:
invokeModel- AnInvokeModelrequest for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to theInvokeModeloperation.
-
fromInvokeModel
public static CountTokensInput fromInvokeModel(Consumer<InvokeModelTokensRequest.Builder> invokeModel)
Create an instance of this class withinvokeModel()initialized to the given value.An
InvokeModelrequest for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to theInvokeModeloperation.- Parameters:
invokeModel- AnInvokeModelrequest for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to theInvokeModeloperation.
-
fromConverse
public static CountTokensInput fromConverse(ConverseTokensRequest converse)
Create an instance of this class withconverse()initialized to the given value.A
Converserequest for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to theConverseoperation.- Parameters:
converse- AConverserequest for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to theConverseoperation.
-
fromConverse
public static CountTokensInput fromConverse(Consumer<ConverseTokensRequest.Builder> converse)
Create an instance of this class withconverse()initialized to the given value.A
Converserequest for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to theConverseoperation.- Parameters:
converse- AConverserequest for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to theConverseoperation.
-
type
public CountTokensInput.Type type()
Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will beCountTokensInput.Type.UNKNOWN_TO_SDK_VERSIONif the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will beCountTokensInput.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-