aixtools 0.2.6__tar.gz → 0.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aixtools might be problematic. Click here for more details.
- {aixtools-0.2.6 → aixtools-0.2.7}/PKG-INFO +1 -1
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/_version.py +3 -3
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/utils.py +36 -13
- {aixtools-0.2.6 → aixtools-0.2.7}/README.md +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/config.toml +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/bn.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/en-US.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/gu.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/he-IL.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/hi.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/ja.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/kn.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/ml.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/mr.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/nl.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/ta.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/te.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/.chainlit/translations/zh-CN.json +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/app.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/card.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/pydantic_ai_adapter/agent_executor.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/pydantic_ai_adapter/storage.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/remote_agent_connection.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/utils.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/agents/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/agents/agent.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/agents/agent_batch.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/agents/print_nodes.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/agents/prompt.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/app.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/auth/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/auth/auth.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/chainlit.md +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/compliance/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/compliance/private_data.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/context.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/db/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/db/database.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/db/vector_db.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/evals/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/evals/__main__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/evals/dataset.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/evals/discovery.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/evals/run_evals.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/google/client.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/app.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/display.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/export.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/filters.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/log_utils.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/log_view/node_summary.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logfilters/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logfilters/context_filter.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/log_objects.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/logging_config.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/mcp_log_models.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/mcp_logger.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/model_patch_logging.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/logging/open_telemetry.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/mcp/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/mcp/client.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/mcp/example_client.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/mcp/example_server.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/mcp/fast_mcp_log.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/mcp/faulty_mcp.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/model_patch/model_patch.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/server/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/server/app_mounter.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/server/path.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/server/utils.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/testing/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/testing/aix_test_model.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/testing/mock_tool.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/testing/model_patch_cache.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/tools/doctor/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/tools/doctor/mcp_tool_doctor.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/tools/doctor/tool_doctor.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/tools/doctor/tool_recommendation.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/chainlit/cl_agent_show.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/chainlit/cl_utils.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/config.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/config_util.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/enum_with_description.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/files.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/persisted_dict.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/utils/utils.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/vault/__init__.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools/vault/vault.py +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/aixtools.egg-info/SOURCES.txt +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/pyproject.toml +0 -0
- {aixtools-0.2.6 → aixtools-0.2.7}/setup.cfg +0 -0
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.2.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
31
|
+
__version__ = version = '0.2.7'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 2, 7)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'gb47ecb535'
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"""Utilities for handling A2A SDK agent cards and connections."""
|
|
2
|
+
|
|
1
3
|
import asyncio
|
|
2
4
|
|
|
3
5
|
import httpx
|
|
@@ -8,13 +10,34 @@ from a2a.utils import AGENT_CARD_WELL_KNOWN_PATH, PREV_AGENT_CARD_WELL_KNOWN_PAT
|
|
|
8
10
|
|
|
9
11
|
from aixtools.a2a.google_sdk.remote_agent_connection import RemoteAgentConnection
|
|
10
12
|
from aixtools.context import DEFAULT_SESSION_ID, DEFAULT_USER_ID, SessionIdTuple
|
|
13
|
+
from aixtools.logging.logging_config import get_logger
|
|
14
|
+
|
|
15
|
+
logger = get_logger(__name__)
|
|
16
|
+
|
|
17
|
+
DEFAULT_A2A_TIMEOUT = 60.0
|
|
11
18
|
|
|
12
19
|
|
|
13
20
|
class AgentCardLoadFailedError(Exception):
|
|
14
21
|
pass
|
|
15
22
|
|
|
16
23
|
|
|
24
|
+
async def get_agent_card(client: httpx.AsyncClient, address: str) -> AgentCard:
|
|
25
|
+
"""Retrieve the agent card from the given agent address."""
|
|
26
|
+
for card_path in [AGENT_CARD_WELL_KNOWN_PATH, PREV_AGENT_CARD_WELL_KNOWN_PATH]:
|
|
27
|
+
try:
|
|
28
|
+
card_resolver = A2ACardResolver(client, address, card_path)
|
|
29
|
+
card = await card_resolver.get_agent_card()
|
|
30
|
+
card.url = address
|
|
31
|
+
return card
|
|
32
|
+
except Exception as e:
|
|
33
|
+
logger.warning(f"Error retrieving agent card from {address} at path {card_path}: {e}")
|
|
34
|
+
|
|
35
|
+
raise AgentCardLoadFailedError(f"Failed to load agent card from {address}")
|
|
36
|
+
|
|
37
|
+
|
|
17
38
|
class _AgentCardResolver:
|
|
39
|
+
"""Helper class to resolve and manage agent cards and their connections."""
|
|
40
|
+
|
|
18
41
|
def __init__(self, client: httpx.AsyncClient):
|
|
19
42
|
self._httpx_client = client
|
|
20
43
|
self._a2a_client_factory = ClientFactory(ClientConfig(httpx_client=self._httpx_client))
|
|
@@ -25,17 +48,13 @@ class _AgentCardResolver:
|
|
|
25
48
|
self.clients[card.name] = remote_connection
|
|
26
49
|
|
|
27
50
|
async def retrieve_card(self, address: str):
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
except Exception as e:
|
|
36
|
-
print(f"Error retrieving agent card from {address} at path {card_path}: {e}")
|
|
37
|
-
|
|
38
|
-
raise AgentCardLoadFailedError(f"Failed to load agent card from {address}")
|
|
51
|
+
try:
|
|
52
|
+
card = await get_agent_card(self._httpx_client, address)
|
|
53
|
+
self.register_agent_card(card)
|
|
54
|
+
return
|
|
55
|
+
except Exception as e:
|
|
56
|
+
logger.error(f"Error retrieving agent card from {address}: {e}")
|
|
57
|
+
return
|
|
39
58
|
|
|
40
59
|
async def get_a2a_clients(self, agent_hosts: list[str]) -> dict[str, RemoteAgentConnection]:
|
|
41
60
|
async with asyncio.TaskGroup() as task_group:
|
|
@@ -45,15 +64,19 @@ class _AgentCardResolver:
|
|
|
45
64
|
return self.clients
|
|
46
65
|
|
|
47
66
|
|
|
48
|
-
async def get_a2a_clients(
|
|
67
|
+
async def get_a2a_clients(
|
|
68
|
+
ctx: SessionIdTuple, agent_hosts: list[str], *, timeout: float = DEFAULT_A2A_TIMEOUT
|
|
69
|
+
) -> dict[str, RemoteAgentConnection]:
|
|
70
|
+
"""Get A2A clients for all agents defined in the configuration."""
|
|
49
71
|
headers = {
|
|
50
72
|
"user-id": ctx[0],
|
|
51
73
|
"session-id": ctx[1],
|
|
52
74
|
}
|
|
53
|
-
httpx_client = httpx.AsyncClient(headers=headers, timeout=
|
|
75
|
+
httpx_client = httpx.AsyncClient(headers=headers, timeout=timeout, follow_redirects=True)
|
|
54
76
|
return await _AgentCardResolver(httpx_client).get_a2a_clients(agent_hosts)
|
|
55
77
|
|
|
56
78
|
|
|
57
79
|
def get_session_id_tuple(context: RequestContext) -> SessionIdTuple:
|
|
80
|
+
"""Get the user_id, session_id tuple from the request context."""
|
|
58
81
|
headers = context.call_context.state.get("headers", {})
|
|
59
82
|
return headers.get("user-id", DEFAULT_USER_ID), headers.get("session-id", DEFAULT_SESSION_ID)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aixtools-0.2.6 → aixtools-0.2.7}/aixtools/a2a/google_sdk/pydantic_ai_adapter/agent_executor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|