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

import typing

import pydantic
import typing_extensions
from ...commons.types.llm_inclusion_status import LlmInclusionStatus
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .knowledge_base_refresh_frequency import KnowledgeBaseRefreshFrequency


class KnowledgeBasePatchRequest(UniversalBaseModel):
    app_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="appId")] = pydantic.Field(
        default=None
    )
    """
    The App ID of the knowledge base to patch. If not provided the ID of the calling app will be used.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the knowledge base.
    """

    tags: typing.Optional[typing.Set[str]] = pydantic.Field(default=None)
    """
    The tags of the knowledge base.
    """

    llm_inclusion_status: typing_extensions.Annotated[
        typing.Optional[LlmInclusionStatus], FieldMetadata(alias="llmInclusionStatus")
    ] = pydantic.Field(default=None)
    """
    Determines whether documents in the knowledge base are sent to the LLM as part of a conversation. Note that at this time knowledge bases can not be set to `ALWAYS`.
    """

    refresh_frequency: typing_extensions.Annotated[
        typing.Optional[KnowledgeBaseRefreshFrequency], FieldMetadata(alias="refreshFrequency")
    ] = pydantic.Field(default=None)
    """
    How often the knowledge base should be refreshed.
    """

    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
