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

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


class BasePromptTemplate(UniversalBaseModel):
    metadata: typing.Dict[str, typing.Optional[typing.Any]]
    template_vars: typing.List[str]
    kwargs: typing.Dict[str, str]
    output_parser: typing.Optional[typing.Any] = None
    template_var_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Template variable mappings (Optional).
    """

    function_mappings: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
    """
    Function mappings (Optional). This is a mapping from template variable names to functions that take in the current kwargs and return a string.
    """

    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
