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:
-
layer(EventSource) -
node(str | None) -
run_step(int)
Source code in src/ant_ai/core/events.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
kind(Literal['event']) -
task_id(str | None) -
session_id(str | None)
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 | |
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:
-
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
kind(Literal['event']) -
task_id(str | None) -
session_id(str | None) -
origin(EventOrigin)
Source code in src/ant_ai/core/events.py
60 61 62 63 64 65 66 | |
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:
-
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
kind(Literal['event']) -
task_id(str | None) -
session_id(str | None) -
origin(EventOrigin)
Source code in src/ant_ai/core/events.py
69 70 71 72 73 74 75 | |
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:
-
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
kind(Literal['event']) -
task_id(str | None) -
session_id(str | None) -
origin(EventOrigin)
Source code in src/ant_ai/core/events.py
78 79 80 81 82 83 84 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['start'])
Source code in src/ant_ai/core/events.py
87 88 89 90 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['final_answer'])
Source code in src/ant_ai/core/events.py
93 94 95 96 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['max_steps_reached'])
Source code in src/ant_ai/core/events.py
99 100 101 102 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['input_required'])
Source code in src/ant_ai/core/events.py
105 106 107 108 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['update'])
Source code in src/ant_ai/core/events.py
111 112 113 114 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['tool_calling'])
Source code in src/ant_ai/core/events.py
117 118 119 120 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['tool_result'])
Source code in src/ant_ai/core/events.py
123 124 125 126 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['reasoning'])
Source code in src/ant_ai/core/events.py
129 130 131 132 | |
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:
-
origin(EventOrigin) -
content(str) -
metadata(dict[str, Any]) -
message(AnyMessage | None) -
task_id(str | None) -
session_id(str | None) -
kind(Literal['completed'])
Source code in src/ant_ai/core/events.py
135 136 137 138 | |