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

from __future__ import annotations
from enum import Enum
from lambdadb.types import BaseModel
from typing import List, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict


class Type(str, Enum):
    KEYWORD = "keyword"
    LONG = "long"
    DOUBLE = "double"
    DATETIME = "datetime"
    BOOLEAN = "boolean"
    SPARSE_VECTOR = "sparseVector"


class IndexConfigsTypedDict(TypedDict):
    r"""Types that do not need additional parameters."""

    type: Type


class IndexConfigs(BaseModel):
    r"""Types that do not need additional parameters."""

    type: Type


class TypeVector(str, Enum):
    VECTOR = "vector"


class Similarity(str, Enum):
    r"""Vector similarity metric."""

    COSINE = "cosine"
    L2_NORM = "l2_norm"
    DOT_PRODUCT = "dot_product"
    MAX_INNER_PRODUCT = "max_inner_product"


class IndexConfigsVectorTypedDict(TypedDict):
    type: TypeVector
    dimensions: int
    r"""Vector dimensions."""
    similarity: NotRequired[Similarity]
    r"""Vector similarity metric."""


class IndexConfigsVector(BaseModel):
    type: TypeVector

    dimensions: int
    r"""Vector dimensions."""

    similarity: Optional[Similarity] = Similarity.COSINE
    r"""Vector similarity metric."""


class TypeText(str, Enum):
    TEXT = "text"


class Analyzer(str, Enum):
    STANDARD = "standard"
    KOREAN = "korean"
    JAPANESE = "japanese"
    ENGLISH = "english"


class IndexConfigsTextTypedDict(TypedDict):
    type: TypeText
    analyzers: NotRequired[List[Analyzer]]
    r"""Analyzers."""


class IndexConfigsText(BaseModel):
    type: TypeText

    analyzers: Optional[List[Analyzer]] = None
    r"""Analyzers."""


IndexConfigsUnionTypedDict = TypeAliasType(
    "IndexConfigsUnionTypedDict",
    Union[
        IndexConfigsTypedDict, IndexConfigsTextTypedDict, IndexConfigsVectorTypedDict
    ],
)


IndexConfigsUnion = TypeAliasType(
    "IndexConfigsUnion", Union[IndexConfigs, IndexConfigsText, IndexConfigsVector]
)
