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

import typing

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


class AgentV1ReceiveFunctionCallResponse(UniversalBaseModel):
    """
    Function call response message used bidirectionally:

    • **Client → Server**: Response after client executes a function
      marked as client_side: true
    • **Server → Client**: Response after server executes a function
      marked as client_side: false

    The same message structure serves both directions, enabling a unified
    interface for function call responses regardless of execution location.
    """

    type: typing.Literal["FunctionCallResponse"] = pydantic.Field(default="FunctionCallResponse")
    """
    Message type identifier for function call responses
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique identifier for the function call.
    
    • **Required for client responses**: Should match the id from
      the corresponding `FunctionCallRequest`
    • **Optional for server responses**: Server may omit when responding
      to internal function executions
    """

    name: str = pydantic.Field()
    """
    The name of the function being called
    """

    content: str = pydantic.Field()
    """
    The content or result of the function call
    """

    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
