Skip to content

ant_ai.core.events

EventSource

EventSource = Literal['agent', 'action', 'workflow']

Sources where events are generated during a run.

EventOrigin pydantic-model

Bases: BaseModel

Describes the origin of an event, used for tracing back to the source of an event in the system.

Show JSON schema:
{
  "$defs": {
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    }
  },
  "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
  "properties": {
    "layer": {
      "$ref": "#/$defs/EventSource",
      "default": "agent",
      "description": "The layer that emitted the event: agent, action, or workflow."
    },
    "node": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Name of the workflow node where the event originated.",
      "title": "Node"
    },
    "run_step": {
      "default": 0,
      "description": "Step index within the current run.",
      "title": "Run Step",
      "type": "integer"
    }
  },
  "title": "EventOrigin",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class EventOrigin(BaseModel):
    """Describes the origin of an event, used for tracing back to the source of an event in the system."""

    layer: EventSource = Field(
        default="agent",
        description="The layer that emitted the event: agent, action, or workflow.",
    )
    node: str | None = Field(
        default=None,
        description="Name of the workflow node where the event originated.",
    )
    run_step: int = Field(
        default=0,
        description="Step index within the current run.",
    )

layer pydantic-field

layer: EventSource = 'agent'

The layer that emitted the event: agent, action, or workflow.

node pydantic-field

node: str | None = None

Name of the workflow node where the event originated.

run_step pydantic-field

run_step: int = 0

Step index within the current run.

Event pydantic-model

Bases: BaseModel

Represents an event emitted during the execution of a workflow, action, or agent.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Represents an event emitted during the execution of a workflow, action, or agent.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "event",
      "default": "event",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "Event",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Event(BaseModel):
    """Represents an event emitted during the execution of a workflow, action, or agent."""

    origin: EventOrigin = Field(
        default_factory=EventOrigin,
        description="Tracing information identifying where in the system the event was emitted.",
    )
    content: str = Field(
        default="",
        description="Textual description of the event.",
    )
    metadata: dict[str, Any] = Field(
        default_factory=dict,
        description="Additional information relevant to the event.",
    )
    message: AnyMessage | None = Field(
        default=None,
        description="Message associated with the event. Only set for events tied to conversation messages.",
    )
    kind: Literal["event"] = "event"
    task_id: str | None = Field(
        default=None,
        description="A2A task ID populated from the raw transport event.",
    )
    session_id: str | None = Field(
        default=None,
        description="A2A context/session ID populated from the raw transport event.",
    )

origin pydantic-field

origin: EventOrigin

Tracing information identifying where in the system the event was emitted.

content pydantic-field

content: str = ''

Textual description of the event.

metadata pydantic-field

metadata: dict[str, Any]

Additional information relevant to the event.

message pydantic-field

message: AnyMessage | None = None

Message associated with the event. Only set for events tied to conversation messages.

task_id pydantic-field

task_id: str | None = None

A2A task ID populated from the raw transport event.

session_id pydantic-field

session_id: str | None = None

A2A context/session ID populated from the raw transport event.

AgentEvent pydantic-model

Bases: Event

Base class for events emitted by the agent layer.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Base class for events emitted by the agent layer.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "event",
      "default": "event",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "AgentEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
60
61
62
63
64
65
66
class AgentEvent(Event):
    """Base class for events emitted by the agent layer."""

    origin: EventOrigin = Field(
        default_factory=lambda: EventOrigin(layer="agent"),
        description="Tracing information identifying where in the system the event was emitted.",
    )

origin pydantic-field

origin: EventOrigin

Tracing information identifying where in the system the event was emitted.

ActionEvent pydantic-model

Bases: Event

Base class for events emitted by the action layer.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Base class for events emitted by the action layer.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "event",
      "default": "event",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "ActionEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
69
70
71
72
73
74
75
class ActionEvent(Event):
    """Base class for events emitted by the action layer."""

    origin: EventOrigin = Field(
        default_factory=lambda: EventOrigin(layer="action"),
        description="Tracing information identifying where in the system the event was emitted.",
    )

origin pydantic-field

origin: EventOrigin

Tracing information identifying where in the system the event was emitted.

WorkflowEvent pydantic-model

Bases: Event

Base class for events emitted by the workflow layer.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Base class for events emitted by the workflow layer.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "event",
      "default": "event",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "WorkflowEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
78
79
80
81
82
83
84
class WorkflowEvent(Event):
    """Base class for events emitted by the workflow layer."""

    origin: EventOrigin = Field(
        default_factory=lambda: EventOrigin(layer="workflow"),
        description="Tracing information identifying where in the system the event was emitted.",
    )

origin pydantic-field

origin: EventOrigin

Tracing information identifying where in the system the event was emitted.

StartEvent pydantic-model

Bases: WorkflowEvent

Emitted when a workflow begins execution.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when a workflow begins execution.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "start",
      "default": "start",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "StartEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
87
88
89
90
class StartEvent(WorkflowEvent):
    """Emitted when a workflow begins execution."""

    kind: Literal["start"] = "start"

FinalAnswerEvent pydantic-model

Bases: AgentEvent

Emitted when the agent produces its final answer.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when the agent produces its final answer.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "final_answer",
      "default": "final_answer",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "FinalAnswerEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
93
94
95
96
class FinalAnswerEvent(AgentEvent):
    """Emitted when the agent produces its final answer."""

    kind: Literal["final_answer"] = "final_answer"

MaxStepsReachedEvent pydantic-model

Bases: AgentEvent

Emitted when the agent exhausts its maximum allowed steps.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when the agent exhausts its maximum allowed steps.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "max_steps_reached",
      "default": "max_steps_reached",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "MaxStepsReachedEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
 99
100
101
102
class MaxStepsReachedEvent(AgentEvent):
    """Emitted when the agent exhausts its maximum allowed steps."""

    kind: Literal["max_steps_reached"] = "max_steps_reached"

ClarificationNeededEvent pydantic-model

Bases: AgentEvent

Emitted when the agent requires human input to continue.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when the agent requires human input to continue.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "input_required",
      "default": "input_required",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "ClarificationNeededEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
105
106
107
108
class ClarificationNeededEvent(AgentEvent):
    """Emitted when the agent requires human input to continue."""

    kind: Literal["input_required"] = "input_required"

UpdateEvent pydantic-model

Bases: WorkflowEvent

Emitted for intermediate status updates during execution.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted for intermediate status updates during execution.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "update",
      "default": "update",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "UpdateEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
111
112
113
114
class UpdateEvent(WorkflowEvent):
    """Emitted for intermediate status updates during execution."""

    kind: Literal["update"] = "update"

ToolCallingEvent pydantic-model

Bases: AgentEvent

Emitted when the agent decides to call one or more tools.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when the agent decides to call one or more tools.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "tool_calling",
      "default": "tool_calling",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "ToolCallingEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
117
118
119
120
class ToolCallingEvent(AgentEvent):
    """Emitted when the agent decides to call one or more tools."""

    kind: Literal["tool_calling"] = "tool_calling"

ToolResultEvent pydantic-model

Bases: AgentEvent

Emitted when a tool call completes and its result is available.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when a tool call completes and its result is available.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "tool_result",
      "default": "tool_result",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "ToolResultEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
123
124
125
126
class ToolResultEvent(AgentEvent):
    """Emitted when a tool call completes and its result is available."""

    kind: Literal["tool_result"] = "tool_result"

ReasoningEvent pydantic-model

Bases: AgentEvent

Emitted when the model produces reasoning/thinking content before its answer.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when the model produces reasoning/thinking content before its answer.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "reasoning",
      "default": "reasoning",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "ReasoningEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
129
130
131
132
class ReasoningEvent(AgentEvent):
    """Emitted when the model produces reasoning/thinking content before its answer."""

    kind: Literal["reasoning"] = "reasoning"

CompletedEvent pydantic-model

Bases: WorkflowEvent

Emitted when a workflow completes successfully.

Show JSON schema:
{
  "$defs": {
    "AnyMessage": {
      "discriminator": {
        "mapping": {
          "message": "#/$defs/Message",
          "tool_call": "#/$defs/ToolCallMessage",
          "tool_call_result": "#/$defs/ToolCallResultMessage"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/Message"
        },
        {
          "$ref": "#/$defs/ToolCallMessage"
        },
        {
          "$ref": "#/$defs/ToolCallResultMessage"
        }
      ]
    },
    "EventOrigin": {
      "description": "Describes the origin of an event, used for tracing back to the source of an event in the system.",
      "properties": {
        "layer": {
          "$ref": "#/$defs/EventSource",
          "default": "agent",
          "description": "The layer that emitted the event: agent, action, or workflow."
        },
        "node": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the workflow node where the event originated.",
          "title": "Node"
        },
        "run_step": {
          "default": 0,
          "description": "Step index within the current run.",
          "title": "Run Step",
          "type": "integer"
        }
      },
      "title": "EventOrigin",
      "type": "object"
    },
    "EventSource": {
      "enum": [
        "agent",
        "action",
        "workflow"
      ],
      "type": "string"
    },
    "Message": {
      "description": "Generic message used in a conversation",
      "properties": {
        "kind": {
          "const": "message",
          "default": "message",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "role"
      ],
      "title": "Message",
      "type": "object"
    },
    "ToolCall": {
      "description": "Single tool call object inside assistant.tool_calls (OpenAI schema).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "default": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ToolFunction"
        }
      },
      "required": [
        "id",
        "function"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "ToolCallMessage": {
      "description": "Message representing a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call",
          "default": "tool_call",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "title": "Tool Calls",
          "type": "array"
        }
      },
      "required": [
        "tool_calls"
      ],
      "title": "ToolCallMessage",
      "type": "object"
    },
    "ToolCallResultMessage": {
      "description": "Message representing the result of a tool call in a conversation",
      "properties": {
        "kind": {
          "const": "tool_call_result",
          "default": "tool_call_result",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "default": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "tool_call_id",
        "name"
      ],
      "title": "ToolCallResultMessage",
      "type": "object"
    },
    "ToolFunction": {
      "description": "Inner function payload for a tool call (OpenAI schema).",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "title": "ToolFunction",
      "type": "object"
    }
  },
  "description": "Emitted when a workflow completes successfully.",
  "properties": {
    "origin": {
      "$ref": "#/$defs/EventOrigin",
      "description": "Tracing information identifying where in the system the event was emitted."
    },
    "content": {
      "default": "",
      "description": "Textual description of the event.",
      "title": "Content",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional information relevant to the event.",
      "title": "Metadata",
      "type": "object"
    },
    "message": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnyMessage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Message associated with the event. Only set for events tied to conversation messages."
    },
    "kind": {
      "const": "completed",
      "default": "completed",
      "title": "Kind",
      "type": "string"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A task ID populated from the raw transport event.",
      "title": "Task Id"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A2A context/session ID populated from the raw transport event.",
      "title": "Session Id"
    }
  },
  "title": "CompletedEvent",
  "type": "object"
}

Fields:

Source code in src/ant_ai/core/events.py
135
136
137
138
class CompletedEvent(WorkflowEvent):
    """Emitted when a workflow completes successfully."""

    kind: Literal["completed"] = "completed"