CountMessageTokensRequest class final

Counts the number of tokens in the prompt sent to a model.

Models may tokenize text differently, so each model may return a different token_count.

Constructors

CountMessageTokensRequest({required String model, required MessagePrompt? prompt})
CountMessageTokensRequest.fromJson(Object? j)
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
model → String
Required. The model's resource name. This serves as an ID for the Model to use.
final
prompt → MessagePrompt?
Required. The prompt, whose token count is to be returned.
final
qualifiedName → String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Object
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

fullyQualifiedName → const String