# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List
from typing_extensions import Literal

from .._models import BaseModel

__all__ = ["CreateEmbeddingResponse", "Data", "Usage"]


class Data(BaseModel):
    """Represents an embedding vector returned by embedding endpoint.

    Fields:
    - index (required): int
    - embedding (required): list[float]
    - object (required): Literal["embedding"]
    """

    embedding: List[float]
    """The embedding vector, which is a list of floats.

    The length of vector depends on the model as listed in the
    [embedding guide](https://platform.openai.com/docs/guides/embeddings).
    """

    index: int
    """The index of the embedding in the list of embeddings."""

    object: Literal["embedding"]
    """The object type, which is always "embedding"."""


class Usage(BaseModel):
    """The usage information for the request."""

    prompt_tokens: int
    """The number of tokens used by the prompt."""

    total_tokens: int
    """The total number of tokens used by the request."""


class CreateEmbeddingResponse(BaseModel):
    """Schema for EmbeddingResponse.

    Fields:
    - data (required): list[Embedding]
    - model (required): str
    - object (required): Literal["list"]
    - usage (required): Usage
    """

    data: List[Data]
    """The list of embeddings generated by the model."""

    model: str
    """The name of the model used to generate the embedding."""

    object: Literal["list"]
    """The object type, which is always "list"."""

    usage: Usage
    """The usage information for the request."""
