ToolCall#

Choose message roles and distinguish model input from stored history. See the guide.

class zett_agent.messages.ToolCall(id, name, arguments=<factory>, error=None)[源代码]#

A complete model request to invoke a named tool.

Unlike ToolCallDelta, arguments must already be a complete mapping suitable for validation and execution.

示例

Construct the normalized result of a provider tool call:

call = ToolCall(
    id="call-7",
    name="read_file",
    arguments={"path": "README.md", "start_line": 1},
)
参数:
  • id (str)

  • name (str)

  • arguments (dict[str, Any])

  • error (str | None)

id: str#

Invocation identifier used to correlate a ToolMessage result.

name: str#

Registered tool name selected by the model.

arguments: dict[str, Any]#

Complete parsed keyword arguments, not a partial JSON delta.

error: str | None#

Why the provider's arguments could not be decoded, if they could not. Such a call is never executed; the Agent reports this text to the model as a failed tool result so it can resend the call.