forked from a2aproject/a2a-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
68 lines (59 loc) · 1.82 KB
/
__init__.py
File metadata and controls
68 lines (59 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""Client-side components for interacting with an A2A agent."""
import logging
from a2a.client.auth import (
AuthInterceptor,
CredentialService,
InMemoryContextCredentialStore,
)
from a2a.client.card_resolver import A2ACardResolver
from a2a.client.client import Client, ClientConfig, ClientEvent, Consumer
from a2a.client.client_factory import (
ClientFactory,
minimal_agent_card,
)
from a2a.client.errors import (
A2AClientError,
A2AClientHTTPError,
A2AClientJSONError,
A2AClientTimeoutError,
)
from a2a.client.helpers import create_text_message_object
from a2a.client.legacy import A2AClient
from a2a.client.middleware import ClientCallContext, ClientCallInterceptor
logger = logging.getLogger(__name__)
try:
from a2a.client.legacy_grpc import A2AGrpcClient
except ImportError as e:
_original_error = e
logger.debug(
'A2AGrpcClient not loaded. This is expected if gRPC dependencies are not installed. Error: %s',
_original_error,
)
class A2AGrpcClient: # type: ignore
"""Placeholder for A2AGrpcClient when dependencies are not installed."""
def __init__(self, *args, **kwargs):
raise ImportError(
'To use A2AGrpcClient, its dependencies must be installed. '
'You can install them with \'pip install "a2a-sdk[grpc]"\''
) from _original_error
__all__ = [
'A2ACardResolver',
'A2AClient',
'A2AClientError',
'A2AClientHTTPError',
'A2AClientJSONError',
'A2AClientTimeoutError',
'A2AGrpcClient',
'AuthInterceptor',
'Client',
'ClientCallContext',
'ClientCallInterceptor',
'ClientConfig',
'ClientEvent',
'ClientFactory',
'Consumer',
'CredentialService',
'InMemoryContextCredentialStore',
'create_text_message_object',
'minimal_agent_card',
]