# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from ..._models import BaseModel

__all__ = ["ChoiceDeltaToolCall", "Function"]


class Function(BaseModel):
    """Schema for ChatCompletionMessageToolCallChunkFunction.

    Fields:
    - name (optional): str
    - arguments (optional): str
    """

    arguments: Optional[str] = None
    """
    The arguments to call the function with, as generated by the model in JSON
    format. Note that the model does not always generate valid JSON, and may
    hallucinate parameters not defined by your function schema. Validate the
    arguments in your code before calling your function.
    """

    name: Optional[str] = None
    """The name of the function to call."""


class ChoiceDeltaToolCall(BaseModel):
    """Schema for ChatCompletionMessageToolCallChunk.

    Fields:
    - index (required): int
    - id (optional): str
    - type (optional): Literal["function"]
    - function (optional): ChatCompletionMessageToolCallChunkFunction
    """

    index: int

    id: Optional[str] = None
    """The ID of the tool call."""

    function: Optional[Function] = None
    """Schema for ChatCompletionMessageToolCallChunkFunction.

    Fields:

    - name (optional): str
    - arguments (optional): str
    """

    type: Optional[Literal["function"]] = None
    """The type of the tool. Currently, only `function` is supported."""
