You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be possible to count number of prompt tokens via GenerativeModel.count_tokens[_async] method before running an actual generation request.
However, the method takes into account only the contents component of a request.
Other components of a request (such as tools, tool_config, and system_instruction) presumably affect prompt token count, so it would be great to support them in the count-token methods too.
The text was updated successfully, but these errors were encountered:
It should be possible to count number of prompt tokens via
GenerativeModel.count_tokens[_async]
method before running an actual generation request.However, the method takes into account only the
contents
component of a request.Other components of a request (such as
tools
,tool_config
, andsystem_instruction
) presumably affect prompt token count, so it would be great to support them in the count-token methods too.The text was updated successfully, but these errors were encountered: