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

from __future__ import annotations
from .toolchoiceallowed import ToolChoiceAllowed, ToolChoiceAllowedTypedDict
from openrouter.types import BaseModel
from typing import Literal, Union
from typing_extensions import TypeAliasType, TypedDict


OpenAIResponsesToolChoiceTypeShell = Literal["shell",]


class OpenAIResponsesToolChoiceShellTypedDict(TypedDict):
    type: OpenAIResponsesToolChoiceTypeShell


class OpenAIResponsesToolChoiceShell(BaseModel):
    type: OpenAIResponsesToolChoiceTypeShell


OpenAIResponsesToolChoiceTypeApplyPatch = Literal["apply_patch",]


class OpenAIResponsesToolChoiceApplyPatchTypedDict(TypedDict):
    type: OpenAIResponsesToolChoiceTypeApplyPatch


class OpenAIResponsesToolChoiceApplyPatch(BaseModel):
    type: OpenAIResponsesToolChoiceTypeApplyPatch


OpenAIResponsesToolChoiceTypeWebSearchPreview = Literal["web_search_preview",]


OpenAIResponsesToolChoiceTypeWebSearchPreview20250311 = Literal[
    "web_search_preview_2025_03_11",
]


TypeTypedDict = TypeAliasType(
    "TypeTypedDict",
    Union[
        OpenAIResponsesToolChoiceTypeWebSearchPreview20250311,
        OpenAIResponsesToolChoiceTypeWebSearchPreview,
    ],
)


Type = TypeAliasType(
    "Type",
    Union[
        OpenAIResponsesToolChoiceTypeWebSearchPreview20250311,
        OpenAIResponsesToolChoiceTypeWebSearchPreview,
    ],
)


class OpenAIResponsesToolChoiceTypedDict(TypedDict):
    type: TypeTypedDict


class OpenAIResponsesToolChoice(BaseModel):
    type: Type


OpenAIResponsesToolChoiceTypeFunction = Literal["function",]


class OpenAIResponsesToolChoiceFunctionTypedDict(TypedDict):
    name: str
    type: OpenAIResponsesToolChoiceTypeFunction


class OpenAIResponsesToolChoiceFunction(BaseModel):
    name: str

    type: OpenAIResponsesToolChoiceTypeFunction


OpenAIResponsesToolChoiceRequired = Literal["required",]


OpenAIResponsesToolChoiceNone = Literal["none",]


OpenAIResponsesToolChoiceAuto = Literal["auto",]


OpenAIResponsesToolChoiceUnionTypedDict = TypeAliasType(
    "OpenAIResponsesToolChoiceUnionTypedDict",
    Union[
        OpenAIResponsesToolChoiceTypedDict,
        OpenAIResponsesToolChoiceApplyPatchTypedDict,
        OpenAIResponsesToolChoiceShellTypedDict,
        OpenAIResponsesToolChoiceFunctionTypedDict,
        ToolChoiceAllowedTypedDict,
        OpenAIResponsesToolChoiceAuto,
        OpenAIResponsesToolChoiceNone,
        OpenAIResponsesToolChoiceRequired,
    ],
)


OpenAIResponsesToolChoiceUnion = TypeAliasType(
    "OpenAIResponsesToolChoiceUnion",
    Union[
        OpenAIResponsesToolChoice,
        OpenAIResponsesToolChoiceApplyPatch,
        OpenAIResponsesToolChoiceShell,
        OpenAIResponsesToolChoiceFunction,
        ToolChoiceAllowed,
        OpenAIResponsesToolChoiceAuto,
        OpenAIResponsesToolChoiceNone,
        OpenAIResponsesToolChoiceRequired,
    ],
)
