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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class CompatibleEndpoint(str, enum.Enum):
    """
    One of the Cohere API endpoints that the model can be used with.
    """

    CHAT = "chat"
    EMBED = "embed"
    CLASSIFY = "classify"
    SUMMARIZE = "summarize"
    RERANK = "rerank"
    RATE = "rate"
    GENERATE = "generate"

    def visit(
        self,
        chat: typing.Callable[[], T_Result],
        embed: typing.Callable[[], T_Result],
        classify: typing.Callable[[], T_Result],
        summarize: typing.Callable[[], T_Result],
        rerank: typing.Callable[[], T_Result],
        rate: typing.Callable[[], T_Result],
        generate: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is CompatibleEndpoint.CHAT:
            return chat()
        if self is CompatibleEndpoint.EMBED:
            return embed()
        if self is CompatibleEndpoint.CLASSIFY:
            return classify()
        if self is CompatibleEndpoint.SUMMARIZE:
            return summarize()
        if self is CompatibleEndpoint.RERANK:
            return rerank()
        if self is CompatibleEndpoint.RATE:
            return rate()
        if self is CompatibleEndpoint.GENERATE:
            return generate()
