|
1 | 1 | import json |
2 | 2 | import logging |
3 | | - |
4 | 3 | from collections.abc import AsyncGenerator |
5 | 4 | from typing import Any |
6 | 5 | from uuid import uuid4 |
7 | 6 |
|
8 | 7 | import httpx |
9 | | - |
10 | 8 | from httpx_sse import SSEError, aconnect_sse |
11 | 9 | from pydantic import ValidationError |
12 | 10 |
|
|
29 | 27 | ) |
30 | 28 | from a2a.utils.telemetry import SpanKind, trace_class |
31 | 29 |
|
32 | | - |
33 | 30 | logger = logging.getLogger(__name__) |
34 | 31 |
|
35 | 32 |
|
@@ -227,6 +224,7 @@ async def send_message( |
227 | 224 | request: The `SendMessageRequest` object containing the message and configuration. |
228 | 225 | http_kwargs: Optional dictionary of keyword arguments to pass to the |
229 | 226 | underlying httpx.post request. |
| 227 | + context: The client call context. |
230 | 228 |
|
231 | 229 | Returns: |
232 | 230 | A `SendMessageResponse` object containing the agent's response (Task or Message) or an error. |
@@ -263,6 +261,7 @@ async def send_message_streaming( |
263 | 261 | request: The `SendStreamingMessageRequest` object containing the message and configuration. |
264 | 262 | http_kwargs: Optional dictionary of keyword arguments to pass to the |
265 | 263 | underlying httpx.post request. A default `timeout=None` is set but can be overridden. |
| 264 | + context: The client call context. |
266 | 265 |
|
267 | 266 | Yields: |
268 | 267 | `SendStreamingMessageResponse` objects as they are received in the SSE stream. |
@@ -354,6 +353,7 @@ async def get_task( |
354 | 353 | request: The `GetTaskRequest` object specifying the task ID and history length. |
355 | 354 | http_kwargs: Optional dictionary of keyword arguments to pass to the |
356 | 355 | underlying httpx.post request. |
| 356 | + context: The client call context. |
357 | 357 |
|
358 | 358 | Returns: |
359 | 359 | A `GetTaskResponse` object containing the Task or an error. |
@@ -395,6 +395,7 @@ async def cancel_task( |
395 | 395 | request: The `CancelTaskRequest` object specifying the task ID. |
396 | 396 | http_kwargs: Optional dictionary of keyword arguments to pass to the |
397 | 397 | underlying httpx.post request. |
| 398 | + context: The client call context. |
398 | 399 |
|
399 | 400 | Returns: |
400 | 401 | A `CancelTaskResponse` object containing the updated Task with canceled status or an error. |
@@ -429,6 +430,7 @@ async def set_task_callback( |
429 | 430 | request: The `SetTaskPushNotificationConfigRequest` object specifying the task ID and configuration. |
430 | 431 | http_kwargs: Optional dictionary of keyword arguments to pass to the |
431 | 432 | underlying httpx.post request. |
| 433 | + context: The client call context. |
432 | 434 |
|
433 | 435 | Returns: |
434 | 436 | A `SetTaskPushNotificationConfigResponse` object containing the confirmation or an error. |
@@ -463,6 +465,7 @@ async def get_task_callback( |
463 | 465 | request: The `GetTaskPushNotificationConfigRequest` object specifying the task ID. |
464 | 466 | http_kwargs: Optional dictionary of keyword arguments to pass to the |
465 | 467 | underlying httpx.post request. |
| 468 | + context: The client call context. |
466 | 469 |
|
467 | 470 | Returns: |
468 | 471 | A `GetTaskPushNotificationConfigResponse` object containing the configuration or an error. |
|
0 commit comments