# 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
from .components_schemas_agent_text_input import ComponentsSchemasAgentTextInput


class InputMessageEvent(UniversalBaseModel):
    """
    An input message event from a user.
    """

    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["input_message"] = "input_message"
    messages: typing.List[ComponentsSchemasAgentTextInput] = pydantic.Field()
    """
    List of inputs that make up this message.
    """

    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
