Source code for agentscope.embedding._embedding_usage
# -*- coding: utf-8 -*-"""The embedding usage class in agentscope."""fromdataclassesimportdataclass,fieldfromtypingimportLiteralfrom.._utils._mixinimportDictMixin
[docs]@dataclassclassEmbeddingUsage(DictMixin):"""The usage of an embedding model API invocation."""time:float"""The time used in seconds."""tokens:int|None=field(default_factory=lambda:None)"""The number of tokens used, if available."""type:Literal["embedding"]=field(default_factory=lambda:"embedding")"""The type of the usage, must be `embedding`."""