agentscope.token._token_base 源代码

# -*- coding: utf-8 -*-
"""The token base class in agentscope."""
from abc import abstractmethod
from typing import Any


[文档] class TokenCounterBase: """The base class for token counting."""
[文档] @abstractmethod async def count( self, messages: list[dict], **kwargs: Any, ) -> int: """Count the number of tokens by the given model and messages."""