"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .outputadvisorservertoolitem import (
    OutputAdvisorServerToolItem,
    OutputAdvisorServerToolItemTypedDict,
)
from .outputapplypatchcallitem import (
    OutputApplyPatchCallItem,
    OutputApplyPatchCallItemTypedDict,
)
from .outputapplypatchservertoolitem import (
    OutputApplyPatchServerToolItem,
    OutputApplyPatchServerToolItemTypedDict,
)
from .outputbashservertoolitem import (
    OutputBashServerToolItem,
    OutputBashServerToolItemTypedDict,
)
from .outputbrowseruseservertoolitem import (
    OutputBrowserUseServerToolItem,
    OutputBrowserUseServerToolItemTypedDict,
)
from .outputcodeinterpretercallitem import (
    OutputCodeInterpreterCallItem,
    OutputCodeInterpreterCallItemTypedDict,
)
from .outputcodeinterpreterservertoolitem import (
    OutputCodeInterpreterServerToolItem,
    OutputCodeInterpreterServerToolItemTypedDict,
)
from .outputcomputercallitem import (
    OutputComputerCallItem,
    OutputComputerCallItemTypedDict,
)
from .outputcustomtoolcallitem import (
    OutputCustomToolCallItem,
    OutputCustomToolCallItemTypedDict,
)
from .outputdatetimeitem import OutputDatetimeItem, OutputDatetimeItemTypedDict
from .outputfilesearchcallitem import (
    OutputFileSearchCallItem,
    OutputFileSearchCallItemTypedDict,
)
from .outputfilesearchservertoolitem import (
    OutputFileSearchServerToolItem,
    OutputFileSearchServerToolItemTypedDict,
)
from .outputfunctioncallitem import (
    OutputFunctionCallItem,
    OutputFunctionCallItemTypedDict,
)
from .outputfusionservertoolitem import (
    OutputFusionServerToolItem,
    OutputFusionServerToolItemTypedDict,
)
from .outputimagegenerationcallitem import (
    OutputImageGenerationCallItem,
    OutputImageGenerationCallItemTypedDict,
)
from .outputimagegenerationservertoolitem import (
    OutputImageGenerationServerToolItem,
    OutputImageGenerationServerToolItemTypedDict,
)
from .outputmcpservertoolitem import (
    OutputMcpServerToolItem,
    OutputMcpServerToolItemTypedDict,
)
from .outputmemoryservertoolitem import (
    OutputMemoryServerToolItem,
    OutputMemoryServerToolItemTypedDict,
)
from .outputmessageitem import OutputMessageItem, OutputMessageItemTypedDict
from .outputreasoningitem import OutputReasoningItem, OutputReasoningItemTypedDict
from .outputsearchmodelsservertoolitem import (
    OutputSearchModelsServerToolItem,
    OutputSearchModelsServerToolItemTypedDict,
)
from .outputshellcallitem import OutputShellCallItem, OutputShellCallItemTypedDict
from .outputshellcalloutputitem import (
    OutputShellCallOutputItem,
    OutputShellCallOutputItemTypedDict,
)
from .outputsubagentservertoolitem import (
    OutputSubagentServerToolItem,
    OutputSubagentServerToolItemTypedDict,
)
from .outputtexteditorservertoolitem import (
    OutputTextEditorServerToolItem,
    OutputTextEditorServerToolItemTypedDict,
)
from .outputtoolsearchservertoolitem import (
    OutputToolSearchServerToolItem,
    OutputToolSearchServerToolItemTypedDict,
)
from .outputwebfetchservertoolitem import (
    OutputWebFetchServerToolItem,
    OutputWebFetchServerToolItemTypedDict,
)
from .outputwebsearchcallitem import (
    OutputWebSearchCallItem,
    OutputWebSearchCallItemTypedDict,
)
from .outputwebsearchservertoolitem import (
    OutputWebSearchServerToolItem,
    OutputWebSearchServerToolItemTypedDict,
)
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


OutputItemsTypedDict = TypeAliasType(
    "OutputItemsTypedDict",
    Union[
        OutputToolSearchServerToolItemTypedDict,
        OutputWebSearchServerToolItemTypedDict,
        OutputFileSearchServerToolItemTypedDict,
        OutputWebSearchCallItemTypedDict,
        OutputFileSearchCallItemTypedDict,
        OutputImageGenerationCallItemTypedDict,
        OutputApplyPatchServerToolItemTypedDict,
        OutputTextEditorServerToolItemTypedDict,
        OutputSearchModelsServerToolItemTypedDict,
        OutputDatetimeItemTypedDict,
        OutputApplyPatchCallItemTypedDict,
        OutputMcpServerToolItemTypedDict,
        OutputShellCallItemTypedDict,
        OutputBrowserUseServerToolItemTypedDict,
        OutputComputerCallItemTypedDict,
        OutputCodeInterpreterCallItemTypedDict,
        OutputCustomToolCallItemTypedDict,
        OutputMemoryServerToolItemTypedDict,
        OutputMessageItemTypedDict,
        OutputShellCallOutputItemTypedDict,
        OutputBashServerToolItemTypedDict,
        OutputFunctionCallItemTypedDict,
        OutputImageGenerationServerToolItemTypedDict,
        OutputWebFetchServerToolItemTypedDict,
        OutputCodeInterpreterServerToolItemTypedDict,
        OutputReasoningItemTypedDict,
        OutputFusionServerToolItemTypedDict,
        OutputAdvisorServerToolItemTypedDict,
        OutputSubagentServerToolItemTypedDict,
    ],
)
r"""An output item from the response"""


OutputItems = Annotated[
    Union[
        Annotated[OutputApplyPatchCallItem, Tag("apply_patch_call")],
        Annotated[OutputCodeInterpreterCallItem, Tag("code_interpreter_call")],
        Annotated[OutputComputerCallItem, Tag("computer_call")],
        Annotated[OutputCustomToolCallItem, Tag("custom_tool_call")],
        Annotated[OutputFileSearchCallItem, Tag("file_search_call")],
        Annotated[OutputFunctionCallItem, Tag("function_call")],
        Annotated[OutputImageGenerationCallItem, Tag("image_generation_call")],
        Annotated[OutputMessageItem, Tag("message")],
        Annotated[OutputAdvisorServerToolItem, Tag("openrouter:advisor")],
        Annotated[OutputApplyPatchServerToolItem, Tag("openrouter:apply_patch")],
        Annotated[OutputBashServerToolItem, Tag("openrouter:bash")],
        Annotated[OutputBrowserUseServerToolItem, Tag("openrouter:browser_use")],
        Annotated[
            OutputCodeInterpreterServerToolItem, Tag("openrouter:code_interpreter")
        ],
        Annotated[OutputDatetimeItem, Tag("openrouter:datetime")],
        Annotated[
            OutputSearchModelsServerToolItem,
            Tag("openrouter:experimental__search_models"),
        ],
        Annotated[OutputFileSearchServerToolItem, Tag("openrouter:file_search")],
        Annotated[OutputFusionServerToolItem, Tag("openrouter:fusion")],
        Annotated[
            OutputImageGenerationServerToolItem, Tag("openrouter:image_generation")
        ],
        Annotated[OutputMcpServerToolItem, Tag("openrouter:mcp")],
        Annotated[OutputMemoryServerToolItem, Tag("openrouter:memory")],
        Annotated[OutputSubagentServerToolItem, Tag("openrouter:subagent")],
        Annotated[OutputTextEditorServerToolItem, Tag("openrouter:text_editor")],
        Annotated[OutputToolSearchServerToolItem, Tag("openrouter:tool_search")],
        Annotated[OutputWebFetchServerToolItem, Tag("openrouter:web_fetch")],
        Annotated[OutputWebSearchServerToolItem, Tag("openrouter:web_search")],
        Annotated[OutputReasoningItem, Tag("reasoning")],
        Annotated[OutputShellCallItem, Tag("shell_call")],
        Annotated[OutputShellCallOutputItem, Tag("shell_call_output")],
        Annotated[OutputWebSearchCallItem, Tag("web_search_call")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""An output item from the response"""
