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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ContextVariableAndValue(UniversalBaseModel):
    """
    A context variable and its current value.
    """

    id: str = pydantic.Field()
    """
    Unique identifier for the context variable
    """

    name: str = pydantic.Field()
    """
    The name of the context variable
    """

    description: str = pydantic.Field()
    """
    The description text assigned to this variable
    """

    key: str = pydantic.Field()
    """
    This is the key which can be used to identify the variable
    """

    value: typing.Optional[typing.Any] = None

    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
