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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .custom_guardrail_config import CustomGuardrailConfig
from .procedure_type import ProcedureType


class ProcedureAtVersionInput(UncheckedBaseModel):
    procedure_id: str = pydantic.Field()
    """
    Procedure ID
    """

    name: str = pydantic.Field()
    """
    Procedure name
    """

    type: typing.Optional[ProcedureType] = None
    trigger: typing.Optional[str] = pydantic.Field(default=None)
    """
    When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it.
    """

    referenced_tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Tool IDs referenced in the procedure content
    """

    referenced_kb_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Knowledge base IDs referenced in the procedure content
    """

    referenced_procedure_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Procedure IDs referenced in the procedure content
    """

    referenced_dynamic_variables: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Dynamic variable names used in the procedure content
    """

    content: str = pydantic.Field()
    """
    Procedure content
    """

    guardrails: typing.Optional[typing.List[CustomGuardrailConfig]] = None
    agent_id: str = pydantic.Field()
    """
    Agent ID of the procedure
    """

    version_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Version ID of a version of the procedure. None for a procedure never versioned.
    """

    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
