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

SendTaskResponse(*, id[, result, error])

Represents the response to a send task request.

Task(*[, id, history, artifacts, metadata])

Represents a unit of work in the A2A protocol.

TaskArtifactUpdateEvent(*, id, artifact, ...)

Represents an event sent when a task generates or updates an artifact.

TaskGetResult(*[, id, error])

Result of a task query in the A2A protocol.

TaskQueryParams(*, id[, historyLength, metadata])

Parameters for querying a task in the A2A protocol.

TaskSendParams(*[, id, sessionId, ...])

Parameters for sending a task to an agent in the A2A protocol.

TaskState(*values)

Enum representing the possible states of a task in the A2A protocol.

TaskStatus(*, state, message, timestamp)

Represents the detailed status of a task in the A2A protocol.

TaskStatusUpdateEvent(*[, id])

Represents an event sent when a task's status changes.

Modules

managment

send_task_request

send_task_response

A2A Send Task Response Model

task

A2A Task Model

task_artifact_update_event

A2A Task Artifact Update Event Model

task_get_result

A2A Task Get Result

task_query_params

A2A Task Query Parameters

task_send_params

A2A Task Send Parameters

task_state

A2A Task State

task_status

A2A Task Status Model

task_status_update_event

A2A Task Status Update Event Model