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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
from .metadata_filters import MetadataFilters
import pydantic
import typing
import datetime as dt
from .llm_parameters import LlmParameters
from .preset_retrieval_params import PresetRetrievalParams
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.pydantic_utilities import update_forward_refs


class PlaygroundSession(UniversalBaseModel):
    """
    A playground session for a user.
    """

    id: str = pydantic.Field()
    """
    Unique identifier
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Creation datetime
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Update datetime
    """

    pipeline_id: str
    user_id: str
    llm_params_id: str
    llm_params: typing.Optional[LlmParameters] = pydantic.Field(default=None)
    """
    LLM parameters last used in this session.
    """

    retrieval_params_id: str
    retrieval_params: typing.Optional[PresetRetrievalParams] = pydantic.Field(default=None)
    """
    Preset retrieval parameters last used in this session.
    """

    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


update_forward_refs(MetadataFilters, PlaygroundSession=PlaygroundSession)
