Spaces:
Paused
Paused
Download src/agentscope/embedding/_embedding_response.py from Akshay66777/agentscope-chat: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/Akshay66777/agentscope-chat/resolve/main/src/agentscope/embedding/_embedding_response.py
- Command line
-
hf download hf://spaces/Akshay66777/agentscope-chat/src/agentscope/embedding/_embedding_response.py
-
curl -L -o _embedding_response.py https://huggingface.co/spaces/Akshay66777/agentscope-chat/resolve/main/src/agentscope/embedding/_embedding_response.py
1.09 kB
| # -*- coding: utf-8 -*- | |
| """The embedding response class.""" | |
| from dataclasses import dataclass, field | |
| from typing import Literal, List | |
| from ._embedding_usage import EmbeddingUsage | |
| from .._utils._common import _get_timestamp | |
| from .._utils._mixin import DictMixin | |
| from ..types import Embedding | |
| class EmbeddingResponse(DictMixin): | |
| """The embedding response class.""" | |
| embeddings: List[Embedding] | |
| """The embedding data""" | |
| id: str = field(default_factory=lambda: _get_timestamp(True)) | |
| """The identity of the embedding response""" | |
| created_at: str = field(default_factory=_get_timestamp) | |
| """The timestamp of the embedding response creation""" | |
| type: Literal["embedding"] = field(default_factory=lambda: "embedding") | |
| """The type of the response, must be `embedding`.""" | |
| usage: EmbeddingUsage | None = field(default_factory=lambda: None) | |
| """The usage of the embedding model API invocation, if available.""" | |
| source: Literal["cache", "api"] = field(default_factory=lambda: "api") | |
| """If the response comes from the cache or the API.""" | |