Skip to content

CountTokensInputDict

Union Type

CountTokensInputDict module-attribute

Dictionary form of CountTokensInput, setting exactly one variant.

Union Member Types

CountTokensInputInvokeModelDict

Bases: TypedDict

Attributes

invoke_model instance-attribute

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.

CountTokensInputConverseDict

Bases: TypedDict

Attributes

converse instance-attribute

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.