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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ObservationType(str, enum.Enum):
    SPAN = "SPAN"
    GENERATION = "GENERATION"
    EVENT = "EVENT"
    AGENT = "AGENT"
    TOOL = "TOOL"
    CHAIN = "CHAIN"
    RETRIEVER = "RETRIEVER"
    EVALUATOR = "EVALUATOR"
    EMBEDDING = "EMBEDDING"
    GUARDRAIL = "GUARDRAIL"

    def visit(
        self,
        span: typing.Callable[[], T_Result],
        generation: typing.Callable[[], T_Result],
        event: typing.Callable[[], T_Result],
        agent: typing.Callable[[], T_Result],
        tool: typing.Callable[[], T_Result],
        chain: typing.Callable[[], T_Result],
        retriever: typing.Callable[[], T_Result],
        evaluator: typing.Callable[[], T_Result],
        embedding: typing.Callable[[], T_Result],
        guardrail: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is ObservationType.SPAN:
            return span()
        if self is ObservationType.GENERATION:
            return generation()
        if self is ObservationType.EVENT:
            return event()
        if self is ObservationType.AGENT:
            return agent()
        if self is ObservationType.TOOL:
            return tool()
        if self is ObservationType.CHAIN:
            return chain()
        if self is ObservationType.RETRIEVER:
            return retriever()
        if self is ObservationType.EVALUATOR:
            return evaluator()
        if self is ObservationType.EMBEDDING:
            return embedding()
        if self is ObservationType.GUARDRAIL:
            return guardrail()
