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

from __future__ import annotations

import typing

import typing_extensions

from .code_execution_node_chat_history_result import CodeExecutionNodeChatHistoryResult
from .code_execution_node_error_result import CodeExecutionNodeErrorResult
from .code_execution_node_json_result import CodeExecutionNodeJsonResult
from .code_execution_node_number_result import CodeExecutionNodeNumberResult
from .code_execution_node_search_results_result import CodeExecutionNodeSearchResultsResult
from .code_execution_node_string_result import CodeExecutionNodeStringResult


class CodeExecutionNodeResultOutput_String(CodeExecutionNodeStringResult):
    type: typing_extensions.Literal["STRING"]

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


class CodeExecutionNodeResultOutput_Number(CodeExecutionNodeNumberResult):
    type: typing_extensions.Literal["NUMBER"]

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


class CodeExecutionNodeResultOutput_Json(CodeExecutionNodeJsonResult):
    type: typing_extensions.Literal["JSON"]

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


class CodeExecutionNodeResultOutput_ChatHistory(CodeExecutionNodeChatHistoryResult):
    type: typing_extensions.Literal["CHAT_HISTORY"]

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


class CodeExecutionNodeResultOutput_SearchResults(CodeExecutionNodeSearchResultsResult):
    type: typing_extensions.Literal["SEARCH_RESULTS"]

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


class CodeExecutionNodeResultOutput_Error(CodeExecutionNodeErrorResult):
    type: typing_extensions.Literal["ERROR"]

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


CodeExecutionNodeResultOutput = typing.Union[
    CodeExecutionNodeResultOutput_String,
    CodeExecutionNodeResultOutput_Number,
    CodeExecutionNodeResultOutput_Json,
    CodeExecutionNodeResultOutput_ChatHistory,
    CodeExecutionNodeResultOutput_SearchResults,
    CodeExecutionNodeResultOutput_Error,
]
