Skip to content

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

acp_type instance-attribute

acp_type: AcpType

The type of the ACP Server (Either sync or async)

agent_input_type class-attribute instance-attribute

agent_input_type: Optional[Literal['text', 'json']] = None

The type of input the agent expects.

created_at instance-attribute

created_at: datetime

The timestamp when the agent was created

description instance-attribute

description: str

The description of the action.

id instance-attribute

id: str

The unique identifier of the agent.

name instance-attribute

name: str

The unique name of the agent.

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.

updated_at instance-attribute

updated_at: datetime

The timestamp when the agent was last updated

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

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

id class-attribute instance-attribute

id: Optional[str] = None

The task message's unique id

task_id instance-attribute

task_id: str

ID of the task this message belongs to

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.

content instance-attribute

content: str

The contents of the text message.

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.

data instance-attribute

data: Dict[str, object]

The contents of the data 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['data'] = 'data'

The type of the message, in this case data.

ToolRequestContent

Bases: BaseModel

arguments instance-attribute

arguments: Dict[str, object]

The arguments to the tool.

author instance-attribute

author: MessageAuthor

The role of the messages author, in this case system, user, assistant, or tool.

name instance-attribute

name: str

The name of the tool that is being requested.

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.

content instance-attribute

content: object

The result of the tool.

name instance-attribute

name: str

The name of the tool that is being responded to.

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

agent_id instance-attribute

agent_id: str

The UUID of the agent that the event belongs to

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

id instance-attribute

id: str

The UUID of the event

sequence_id instance-attribute

sequence_id: int

The sequence ID of the event

task_id instance-attribute

task_id: str

The UUID of the task that the event belongs to

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.

created_at instance-attribute

created_at: datetime

The timestamp when the state was created

id instance-attribute

id: str

The task state's unique id

updated_at class-attribute instance-attribute

updated_at: Optional[datetime] = None

The timestamp when the state was last updated

Usage Examples

For practical usage examples and patterns, see: