Skip to content

SuggestedFunctionCall

fastagency.SuggestedFunctionCall dataclass #

SuggestedFunctionCall(
    workflow_uuid: str,
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: str = lambda: str(hex)(),
    function_name: Optional[str] = None,
    call_id: Optional[str] = None,
    arguments: dict[str, Any] = dict(),
)

Bases: IOMessage

arguments class-attribute instance-attribute #

arguments: dict[str, Any] = field(default_factory=dict)

auto_reply class-attribute instance-attribute #

auto_reply: bool = False

call_id class-attribute instance-attribute #

call_id: Optional[str] = None

function_name class-attribute instance-attribute #

function_name: Optional[str] = None

recipient class-attribute instance-attribute #

recipient: Optional[str] = None

sender class-attribute instance-attribute #

sender: Optional[str] = None

type property #

type: MessageType

uuid class-attribute instance-attribute #

uuid: str = field(default_factory=lambda: str(hex))

workflow_uuid instance-attribute #

workflow_uuid: str

create staticmethod #

create(
    type: Optional[MessageType] = None, **kwargs: Any
) -> IOMessage
Source code in fastagency/messages.py
@staticmethod
def create(type: Optional[MessageType] = None, **kwargs: Any) -> "IOMessage":
    cls = IOMessage._get_message_class(type)

    content = kwargs.pop("content", {})
    kwargs.update(content)

    return cls(**kwargs)

model_dump #

model_dump() -> dict[str, Any]
Source code in fastagency/messages.py
def model_dump(self) -> dict[str, Any]:
    params_names = IOMessage._get_parameters_names()
    d = asdict(self)
    content = {k: v for k, v in d.items() if k not in params_names}
    retval = {k: v for k, v in d.items() if k in params_names}
    retval["content"] = content
    retval["type"] = self.type
    return retval