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

import typing

import pydantic
import typing_extensions
from ...commons.types.llm_persona import LlmPersona
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata


class AgentPrompting(UniversalBaseModel):
    persona: LlmPersona = pydantic.Field()
    """
    The overall persona of the agent.
    """

    additional_prompt_text: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="additionalPromptText")
    ] = pydantic.Field(default=None)
    """
    Additional text directly appended to the prompt. This field is replaced by Knowledge Documents with `llmInclusionsStatus` set to `ALWAYS`.
    """

    category_generation_prompt_text: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="categoryGenerationPromptText")
    ] = pydantic.Field(default=None)
    """
    LLM prompt for category generation. 
    
    Use this to specify a fixed set of categories that an LLM should choose from when analyzing a conversation. 
    When not set uses a default prompt which gives the LLM flexibility to determine appropriate categories on its own.
    """

    content_safety_violation_response_prompt_text: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="contentSafetyViolationResponsePromptText")
    ] = pydantic.Field(default=None)
    """
    LLM prompt for generating a response when the user's question has been detected as unsafe. 
    
    Use this to provide custom LLM generated replies when dealing with content safety violations.
    When not set, the system fallback message will be used and replies will not be personalized by the LLM as it will not be involved.
    """

    reject_questions_without_knowledge: typing_extensions.Annotated[
        bool, FieldMetadata(alias="rejectQuestionsWithoutKnowledge")
    ] = pydantic.Field()
    """
    Return the system fallback message on all questions that have no relevant knowledge bases or actions.
    """

    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
