# generated by datamodel-codegen:
#   filename:  discriminator_enum_single_value_anyof.yaml
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from enum import Enum
from typing import Literal

from pydantic import BaseModel, Field, RootModel


class ToolType(Enum):
    function = 'function'


class FunctionToolCall(BaseModel):
    id: str
    type: Literal[ToolType.function]


class CustomToolCall(BaseModel):
    type: Literal['CustomToolCall']


class ToolCallUnion(RootModel[FunctionToolCall | CustomToolCall]):
    root: FunctionToolCall | CustomToolCall = Field(..., discriminator='type')
