# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class EmbedInputType(str, enum.Enum):
    """
    Specifies the type of input passed to the model. Required for embedding models v3 and higher.

    - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
    - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
    - `"classification"`: Used for embeddings passed through a text classifier.
    - `"clustering"`: Used for the embeddings run through a clustering algorithm.
    """

    SEARCH_DOCUMENT = "search_document"
    SEARCH_QUERY = "search_query"
    CLASSIFICATION = "classification"
    CLUSTERING = "clustering"

    def visit(
        self,
        search_document: typing.Callable[[], T_Result],
        search_query: typing.Callable[[], T_Result],
        classification: typing.Callable[[], T_Result],
        clustering: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is EmbedInputType.SEARCH_DOCUMENT:
            return search_document()
        if self is EmbedInputType.SEARCH_QUERY:
            return search_query()
        if self is EmbedInputType.CLASSIFICATION:
            return classification()
        if self is EmbedInputType.CLUSTERING:
            return clustering()
