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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .agent_step_instruction import AgentStepInstruction
from .components_schemas_default_output_parser import ComponentsSchemasDefaultOutputParser


class ConversationalAgentStep(UniversalBaseModel):
    """
    A step that receives instructions and responds through dialogue. This is a step that gets instructions and engages in conversation with users based on those instructions. This only type step supported, with no way to go next steps. A conversational step responds to an input following its instructions and uses the agent tools. The first response from the model will terminate processing the input.
    """

    type: typing.Literal["conversational"] = "conversational"
    instructions: typing.List[AgentStepInstruction] = pydantic.Field()
    """
    List of instructions that guide the agent's behavior in this step. If no instructions are given, the agent is instructed to be helpful and use tools.
    """

    output_parser: ComponentsSchemasDefaultOutputParser

    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
