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

from __future__ import annotations

import typing

from .terminal_node_array_result import TerminalNodeArrayResult
from .terminal_node_chat_history_result import TerminalNodeChatHistoryResult
from .terminal_node_error_result import TerminalNodeErrorResult
from .terminal_node_function_call_result import TerminalNodeFunctionCallResult
from .terminal_node_json_result import TerminalNodeJsonResult
from .terminal_node_number_result import TerminalNodeNumberResult
from .terminal_node_search_results_result import TerminalNodeSearchResultsResult
from .terminal_node_string_result import TerminalNodeStringResult


class TerminalNodeResultOutput_String(TerminalNodeStringResult):
    type: typing.Literal["STRING"] = "STRING"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_Number(TerminalNodeNumberResult):
    type: typing.Literal["NUMBER"] = "NUMBER"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_Json(TerminalNodeJsonResult):
    type: typing.Literal["JSON"] = "JSON"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_ChatHistory(TerminalNodeChatHistoryResult):
    type: typing.Literal["CHAT_HISTORY"] = "CHAT_HISTORY"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_SearchResults(TerminalNodeSearchResultsResult):
    type: typing.Literal["SEARCH_RESULTS"] = "SEARCH_RESULTS"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_Array(TerminalNodeArrayResult):
    type: typing.Literal["ARRAY"] = "ARRAY"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_FunctionCall(TerminalNodeFunctionCallResult):
    type: typing.Literal["FUNCTION_CALL"] = "FUNCTION_CALL"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class TerminalNodeResultOutput_Error(TerminalNodeErrorResult):
    type: typing.Literal["ERROR"] = "ERROR"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


TerminalNodeResultOutput = typing.Union[
    TerminalNodeResultOutput_String,
    TerminalNodeResultOutput_Number,
    TerminalNodeResultOutput_Json,
    TerminalNodeResultOutput_ChatHistory,
    TerminalNodeResultOutput_SearchResults,
    TerminalNodeResultOutput_Array,
    TerminalNodeResultOutput_FunctionCall,
    TerminalNodeResultOutput_Error,
]
