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

from __future__ import annotations
from .responsesimagegenerationcall import (
    ResponsesImageGenerationCall,
    ResponsesImageGenerationCallTypedDict,
)
from .responsesoutputitemfilesearchcall import (
    ResponsesOutputItemFileSearchCall,
    ResponsesOutputItemFileSearchCallTypedDict,
)
from .responsesoutputitemfunctioncall import (
    ResponsesOutputItemFunctionCall,
    ResponsesOutputItemFunctionCallTypedDict,
)
from .responsesoutputitemreasoning import (
    ResponsesOutputItemReasoning,
    ResponsesOutputItemReasoningTypedDict,
)
from .responsesoutputmessage import (
    ResponsesOutputMessage,
    ResponsesOutputMessageTypedDict,
)
from .responseswebsearchcalloutput import (
    ResponsesWebSearchCallOutput,
    ResponsesWebSearchCallOutputTypedDict,
)
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


ResponsesOutputItemTypedDict = TypeAliasType(
    "ResponsesOutputItemTypedDict",
    Union[
        ResponsesWebSearchCallOutputTypedDict,
        ResponsesOutputItemFileSearchCallTypedDict,
        ResponsesImageGenerationCallTypedDict,
        ResponsesOutputMessageTypedDict,
        ResponsesOutputItemFunctionCallTypedDict,
        ResponsesOutputItemReasoningTypedDict,
    ],
)
r"""An output item from the response"""


ResponsesOutputItem = Annotated[
    Union[
        Annotated[ResponsesOutputMessage, Tag("message")],
        Annotated[ResponsesOutputItemReasoning, Tag("reasoning")],
        Annotated[ResponsesOutputItemFunctionCall, Tag("function_call")],
        Annotated[ResponsesWebSearchCallOutput, Tag("web_search_call")],
        Annotated[ResponsesOutputItemFileSearchCall, Tag("file_search_call")],
        Annotated[ResponsesImageGenerationCall, Tag("image_generation_call")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""An output item from the response"""
