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

from __future__ import annotations
from .toolcallstatus import ToolCallStatus
from openrouter.types import BaseModel
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


FunctionCallItemType = Literal["function_call",]


class FunctionCallItemTypedDict(TypedDict):
    r"""A function call initiated by the model"""

    arguments: str
    call_id: str
    id: str
    name: str
    type: FunctionCallItemType
    namespace: NotRequired[str]
    r"""Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"""
    status: NotRequired[ToolCallStatus]


class FunctionCallItem(BaseModel):
    r"""A function call initiated by the model"""

    arguments: str

    call_id: str

    id: str

    name: str

    type: FunctionCallItemType

    namespace: Optional[str] = None
    r"""Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"""

    status: Annotated[
        Optional[ToolCallStatus], PlainValidator(validate_open_enum(False))
    ] = None
