Spaces:
Paused
Paused
Download src/agentscope/embedding/_embedding_usage.py from Akshay66777/agentscope-chat: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/spaces/Akshay66777/agentscope-chat/resolve/main/src/agentscope/embedding/_embedding_usage.py
- Command line
-
hf download hf://spaces/Akshay66777/agentscope-chat/src/agentscope/embedding/_embedding_usage.py
-
curl -L -o _embedding_usage.py https://huggingface.co/spaces/Akshay66777/agentscope-chat/resolve/main/src/agentscope/embedding/_embedding_usage.py
579 Bytes
| # -*- coding: utf-8 -*- | |
| """The embedding usage class in agentscope.""" | |
| from dataclasses import dataclass, field | |
| from typing import Literal | |
| from .._utils._mixin import DictMixin | |
| class EmbeddingUsage(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`.""" | |