Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
text_embedding_entities.py30 linesDownload Raw Back to entities
1from decimal import Decimal2 3from pydantic import BaseModel4 5from core.model_runtime.entities.model_entities import ModelUsage6 7 8class EmbeddingUsage(ModelUsage):9    """10    Model class for embedding usage.11    """12 13    tokens: int14    total_tokens: int15    unit_price: Decimal16    price_unit: Decimal17    total_price: Decimal18    currency: str19    latency: float20 21 22class TextEmbeddingResult(BaseModel):23    """24    Model class for text embedding result.25    """26 27    model: str28    embeddings: list[list[float]]29    usage: EmbeddingUsage30