"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from friendli.core.types import BaseModel
from friendli.core.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import List, Literal, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict

EmbeddingTypedDict = TypeAliasType("EmbeddingTypedDict", Union[List[float], bytes])
"The embedding vector, which is a list of floats or a base64-encoded string. The length of vector depends on the model."
Embedding = TypeAliasType("Embedding", Union[List[float], bytes])
"The embedding vector, which is a list of floats or a base64-encoded string. The length of vector depends on the model."


class EmbeddingObjectTypedDict(TypedDict):
    index: int
    "The index of the embedding in the list of embeddings."
    embedding: EmbeddingTypedDict
    "The embedding vector, which is a list of floats or a base64-encoded string. The length of vector depends on the model."
    object: Literal["embedding"]
    "The object type, which is always set to `embedding`."


class EmbeddingObject(BaseModel):
    index: int
    "The index of the embedding in the list of embeddings."
    embedding: Embedding
    "The embedding vector, which is a list of floats or a base64-encoded string. The length of vector depends on the model."
    OBJECT: Annotated[
        Annotated[Literal["embedding"], AfterValidator(validate_const("embedding"))],
        pydantic.Field(alias="object"),
    ] = "embedding"
    "The object type, which is always set to `embedding`."
