Types Reference¶
Comprehensive API reference for all core object types in Agentex. These types are automatically generated from the source code.
ACP Parameters¶
CreateTaskParams¶
Bases: BaseModel
Parameters for task/create method.
Attributes:
| Name | Type | Description |
|---|---|---|
agent |
Agent
|
The agent that the task was sent to. |
task |
Task
|
The task to be created. |
params |
dict[str, Any] | None
|
The parameters for the task as inputted by the user. |
request |
dict[str, Any] | None
|
Additional request context including headers forwarded to this agent. |
SendMessageParams¶
Bases: BaseModel
Parameters for message/send method.
Attributes:
| Name | Type | Description |
|---|---|---|
agent |
Agent
|
The agent that the message was sent to. |
task |
Task
|
The task that the message was sent to. |
content |
TaskMessageContent
|
The message that was sent to the agent. |
stream |
bool
|
Whether to stream the message back to the agentex server from the agent. |
request |
dict[str, Any] | None
|
Additional request context including headers forwarded to this agent. |
SendEventParams¶
Bases: BaseModel
Parameters for event/send method.
Attributes:
| Name | Type | Description |
|---|---|---|
agent |
Agent
|
The agent that the event was sent to. |
task |
Task
|
The task that the message was sent to. |
event |
Event
|
The event that was sent to the agent. |
request |
dict[str, Any] | None
|
Additional request context including headers forwarded to this agent. |
CancelTaskParams¶
Bases: BaseModel
Parameters for task/cancel method.
Attributes:
| Name | Type | Description |
|---|---|---|
agent |
Agent
|
The agent that the task was sent to. |
task |
Task
|
The task that was cancelled. |
request |
dict[str, Any] | None
|
Additional request context including headers forwarded to this agent. |
Agent¶
Bases: BaseModel
agent_input_type
class-attribute
instance-attribute
¶
agent_input_type: Optional[Literal['text', 'json']] = None
The type of input the agent expects.
registered_at
class-attribute
instance-attribute
¶
registered_at: Optional[datetime] = None
The timestamp when the agent was last registered
registration_metadata
class-attribute
instance-attribute
¶
registration_metadata: Optional[Dict[str, object]] = None
The metadata for the agent's registration.
status
class-attribute
instance-attribute
¶
status: Optional[
Literal[
"Ready", "Failed", "Unknown", "Deleted", "Unhealthy"
]
] = None
The status of the action, indicating if it's building, ready, failed, etc.
status_reason
class-attribute
instance-attribute
¶
status_reason: Optional[str] = None
The reason for the status of the action.
ACPType¶
Task¶
Bases: BaseModel
TaskMessage¶
Bases: BaseModel
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
content
instance-attribute
¶
content: TaskMessageContent
The content of the message.
This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
created_at
class-attribute
instance-attribute
¶
created_at: Optional[datetime] = None
The timestamp when the message was created
updated_at
class-attribute
instance-attribute
¶
updated_at: Optional[datetime] = None
The timestamp when the message was last updated
TaskMessageContent
module-attribute
¶
TaskMessageContent: TypeAlias = Annotated[
Union[
TextContent,
ReasoningContent,
DataContent,
ToolRequestContent,
ToolResponseContent,
],
PropertyInfo(discriminator="type"),
]
TextContent¶
Bases: BaseModel
attachments
class-attribute
instance-attribute
¶
attachments: Optional[List[Attachment]] = None
Optional list of file attachments with structured metadata.
author
instance-attribute
¶
author: MessageAuthor
The role of the messages author, in this case system, user, assistant, or
tool.
format
class-attribute
instance-attribute
¶
format: TextFormat = 'plain'
The format of the message.
This is used by the client to determine how to display the message.
style
class-attribute
instance-attribute
¶
style: MessageStyle = 'static'
The style of the message.
This is used by the client to determine how to display the message.
type
class-attribute
instance-attribute
¶
type: Literal['text'] = 'text'
The type of the message, in this case text.
DataContent¶
Bases: BaseModel
author
instance-attribute
¶
author: MessageAuthor
The role of the messages author, in this case system, user, assistant, or
tool.
style
class-attribute
instance-attribute
¶
style: MessageStyle = 'static'
The style of the message.
This is used by the client to determine how to display the message.
type
class-attribute
instance-attribute
¶
type: Literal['data'] = 'data'
The type of the message, in this case data.
ToolRequestContent¶
Bases: BaseModel
author
instance-attribute
¶
author: MessageAuthor
The role of the messages author, in this case system, user, assistant, or
tool.
style
class-attribute
instance-attribute
¶
style: MessageStyle = 'static'
The style of the message.
This is used by the client to determine how to display the message.
tool_call_id
instance-attribute
¶
tool_call_id: str
The ID of the tool call that is being requested.
type
class-attribute
instance-attribute
¶
type: Literal['tool_request'] = 'tool_request'
The type of the message, in this case tool_request.
ToolResponseContent¶
Bases: BaseModel
author
instance-attribute
¶
author: MessageAuthor
The role of the messages author, in this case system, user, assistant, or
tool.
style
class-attribute
instance-attribute
¶
style: MessageStyle = 'static'
The style of the message.
This is used by the client to determine how to display the message.
tool_call_id
instance-attribute
¶
tool_call_id: str
The ID of the tool call that is being responded to.
type
class-attribute
instance-attribute
¶
type: Literal['tool_response'] = 'tool_response'
The type of the message, in this case tool_response.
TaskMessageUpdate
module-attribute
¶
TaskMessageUpdate: TypeAlias = Annotated[
Union[
StreamTaskMessageStart,
StreamTaskMessageDelta,
StreamTaskMessageFull,
StreamTaskMessageDone,
],
PropertyInfo(discriminator="type"),
]
StreamTaskMessageStart¶
Bases: BaseModel
Event for starting a streaming message
parent_task_message
class-attribute
instance-attribute
¶
parent_task_message: Optional[TaskMessage] = None
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
StreamTaskMessageDelta¶
Bases: BaseModel
Event for streaming chunks of content
delta
class-attribute
instance-attribute
¶
delta: Optional[TaskMessageDelta] = None
Delta for text updates
parent_task_message
class-attribute
instance-attribute
¶
parent_task_message: Optional[TaskMessage] = None
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
StreamTaskMessageFull¶
Bases: BaseModel
Event for streaming the full content
parent_task_message
class-attribute
instance-attribute
¶
parent_task_message: Optional[TaskMessage] = None
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
StreamTaskMessageDone¶
Bases: BaseModel
Event for indicating the task is done
parent_task_message
class-attribute
instance-attribute
¶
parent_task_message: Optional[TaskMessage] = None
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
TaskMessageDelta
module-attribute
¶
TaskMessageDelta: TypeAlias = Annotated[
Union[
TextDelta,
DataDelta,
ToolRequestDelta,
ToolResponseDelta,
ReasoningSummaryDelta,
ReasoningContentDelta,
],
PropertyInfo(discriminator="type"),
]
TextDelta¶
Bases: BaseModel
Delta for text updates
DataDelta¶
Bases: BaseModel
Delta for data updates
ToolRequestDelta¶
Bases: BaseModel
Delta for tool request updates
ToolResponseDelta¶
Bases: BaseModel
Delta for tool response updates
Event¶
Bases: BaseModel
content
class-attribute
instance-attribute
¶
content: Optional[TaskMessageContent] = None
The content of the event
created_at
class-attribute
instance-attribute
¶
created_at: Optional[datetime] = None
The timestamp of the event
State¶
Bases: BaseModel
Represents a state in the agent system.
A state is associated uniquely with a task and an agent.
This entity is used to store states in MongoDB, with each state associated with a specific task and agent. The combination of task_id and agent_id is globally unique.
The state is a dictionary of arbitrary data.
Usage Examples¶
For practical usage examples and patterns, see:
- Task Concepts - Understanding tasks and their lifecycle
- TaskMessage Concepts - Working with messages
- Streaming Concepts - Real-time message streaming
- State Concepts - Managing persistent state
- Agent-to-Client Protocol (ACP) - Sync and Async ACP handler parameters explained