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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Turn(UniversalBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the turn.
    """

    chat_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the chat the turn resides in.
    """

    query: typing.Optional[str] = pydantic.Field(default=None)
    """
    The query made to produce this turn.
    """

    answer: typing.Optional[str] = pydantic.Field(default=None)
    """
    The response to the query.
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the turn is enabled and shown in futures turns of the chat.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Specifies when the turn 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
