Skip to content

Commit b503b1c

Browse files
committed
Fix linter errors.
1 parent c9fe26c commit b503b1c

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

src/a2a/client/auth/credentials.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ async def get_credentials(
3232
security_scheme_name: str,
3333
context: ClientCallContext | None,
3434
) -> str | None:
35+
"""Retrieves credentials from the in-memory store.
36+
37+
Args:
38+
security_scheme_name: The name of the security scheme.
39+
context: The client call context.
40+
41+
Returns:
42+
The credential string, or None if not found.
43+
"""
3544
if not context or 'sessionId' not in context.state:
3645
return None
3746
session_id = context.state['sessionId']

src/a2a/client/auth/interceptor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
OpenIdConnectSecurityScheme,
1313
)
1414

15-
1615
logger = logging.getLogger(__name__)
1716

1817

1918
class AuthInterceptor(ClientCallInterceptor):
20-
"""An interceptor that automatically adds authentication details to requests
21-
based on the agent's security schemes.
19+
"""An interceptor that automatically adds authentication details to requests.
20+
21+
Based on the agent's security schemes.
2222
"""
2323

2424
def __init__(self, credential_service: CredentialService):

src/a2a/client/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import json
22
import logging
3-
43
from collections.abc import AsyncGenerator
54
from typing import Any
65
from uuid import uuid4
76

87
import httpx
9-
108
from httpx_sse import SSEError, aconnect_sse
119
from pydantic import ValidationError
1210

@@ -29,7 +27,6 @@
2927
)
3028
from a2a.utils.telemetry import SpanKind, trace_class
3129

32-
3330
logger = logging.getLogger(__name__)
3431

3532

@@ -227,6 +224,7 @@ async def send_message(
227224
request: The `SendMessageRequest` object containing the message and configuration.
228225
http_kwargs: Optional dictionary of keyword arguments to pass to the
229226
underlying httpx.post request.
227+
context: The client call context.
230228
231229
Returns:
232230
A `SendMessageResponse` object containing the agent's response (Task or Message) or an error.
@@ -263,6 +261,7 @@ async def send_message_streaming(
263261
request: The `SendStreamingMessageRequest` object containing the message and configuration.
264262
http_kwargs: Optional dictionary of keyword arguments to pass to the
265263
underlying httpx.post request. A default `timeout=None` is set but can be overridden.
264+
context: The client call context.
266265
267266
Yields:
268267
`SendStreamingMessageResponse` objects as they are received in the SSE stream.
@@ -354,6 +353,7 @@ async def get_task(
354353
request: The `GetTaskRequest` object specifying the task ID and history length.
355354
http_kwargs: Optional dictionary of keyword arguments to pass to the
356355
underlying httpx.post request.
356+
context: The client call context.
357357
358358
Returns:
359359
A `GetTaskResponse` object containing the Task or an error.
@@ -395,6 +395,7 @@ async def cancel_task(
395395
request: The `CancelTaskRequest` object specifying the task ID.
396396
http_kwargs: Optional dictionary of keyword arguments to pass to the
397397
underlying httpx.post request.
398+
context: The client call context.
398399
399400
Returns:
400401
A `CancelTaskResponse` object containing the updated Task with canceled status or an error.
@@ -429,6 +430,7 @@ async def set_task_callback(
429430
request: The `SetTaskPushNotificationConfigRequest` object specifying the task ID and configuration.
430431
http_kwargs: Optional dictionary of keyword arguments to pass to the
431432
underlying httpx.post request.
433+
context: The client call context.
432434
433435
Returns:
434436
A `SetTaskPushNotificationConfigResponse` object containing the confirmation or an error.
@@ -463,6 +465,7 @@ async def get_task_callback(
463465
request: The `GetTaskPushNotificationConfigRequest` object specifying the task ID.
464466
http_kwargs: Optional dictionary of keyword arguments to pass to the
465467
underlying httpx.post request.
468+
context: The client call context.
466469
467470
Returns:
468471
A `GetTaskPushNotificationConfigResponse` object containing the configuration or an error.

src/a2a/client/middleware.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
class ClientCallContext(BaseModel):
1414
"""A context passed with each client call, allowing for call-specific
15-
configuration and data passing, such as authentication details or
16-
request deadlines.
15+
configuration and data passing.
16+
17+
Such as authentication details or request deadlines.
1718
"""
1819

1920
state: MutableMapping[str, Any] = Field(default_factory=dict)

0 commit comments

Comments
 (0)