CountTokensInput - Amazon Bedrock
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

CountTokensInput

The input value for token counting. The value should be either an InvokeModel or Converse request body.

Contents

Important

This data type is a UNION, so only one of the following members can be specified when used or returned.

converse

A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.

Type: ConverseTokensRequest object

Required: No

invokeModel

An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.

Type: InvokeModelTokensRequest object

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: