# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .agent_session_key import AgentSessionKey


class ToolInputEvent(UniversalBaseModel):
    """
    An event representing input to a tool call.
    """

    id: str = pydantic.Field()
    """
    The unique identifier for the event.
    """

    session_key: AgentSessionKey = pydantic.Field()
    """
    The key of the session this event belongs to.
    """

    type: typing.Literal["tool_input"] = "tool_input"
    tool_call_id: str = pydantic.Field()
    """
    The identifier for the tool call.
    """

    tool_configuration_name: str = pydantic.Field()
    """
    The name of the tool configuration being invoked, as defined in the agent's tool_configurations map.
    """

    tool_name: str = pydantic.Field()
    """
    Name of the tool being called.
    """

    tool_input: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    Input data for the tool.
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Timestamp when the event was created.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
