Skip to content

ClientToolCall

autogen.beta.events.types.ClientToolCall #

Bases: ToolCall

id class-attribute instance-attribute #

id = Field(default_factory=lambda: str(uuid4()))

name instance-attribute #

name

arguments class-attribute instance-attribute #

arguments = '{}'

serialized_arguments property writable #

serialized_arguments

from_call classmethod #

from_call(call)
Source code in autogen/beta/events/types.py
@classmethod
def from_call(cls, call: ToolCall) -> "ClientToolCall":
    return cls(
        parent_id=call.id,
        name=call.name,
        arguments=call.arguments,
    )

to_api #

to_api()
Source code in autogen/beta/events/types.py
def to_api(self) -> dict[str, Any]:
    return {
        "id": self.id,
        "type": "function",
        "function": {
            "arguments": json.dumps(self.serialized_arguments),
            "name": self.name,
        },
    }