agentle.agents.a2a.tasks¶
A2A Tasks Package
This package provides classes for managing tasks in the A2A protocol. Tasks are the central unit of work in the A2A protocol, representing conversations between users and agents and tracking their state and progress.
The package includes: - Task models and state tracking - Task management functionality - Task parameter models for sending and querying - Task result models for responses - Event models for task updates
Example
```python from agentle.agents.a2a.tasks.task import Task from agentle.agents.a2a.tasks.task_state import TaskState from agentle.agents.a2a.messages.message import Message from agentle.agents.a2a.message_parts.text_part import TextPart
# Create a message message = Message(
role=”user”, parts=[TextPart(text=”Hello, can you help me?”)]
)
# Create a task task = Task(
sessionId=”session-123”, status=TaskState.SUBMITTED, history=[message]
)
# Check task status print(f”Task ID: {task.id}”) print(f”Task Status: {task.status}”) ```
Classes
|
Represents the response to a send task request. |
|
Represents a unit of work in the A2A protocol. |
|
Represents an event sent when a task generates or updates an artifact. |
|
Result of a task query in the A2A protocol. |
|
Parameters for querying a task in the A2A protocol. |
|
Parameters for sending a task to an agent in the A2A protocol. |
|
Enum representing the possible states of a task in the A2A protocol. |
|
Represents the detailed status of a task in the A2A protocol. |
|
Represents an event sent when a task's status changes. |
Modules
A2A Send Task Response Model |
|
A2A Task Model |
|
A2A Task Artifact Update Event Model |
|
A2A Task Get Result |
|
A2A Task Query Parameters |
|
A2A Task Send Parameters |
|
A2A Task State |
|
A2A Task Status Model |
|
A2A Task Status Update Event Model |