aixtools 0.2.6__tar.gz → 0.2.8__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.

Files changed (97) hide show
  1. {aixtools-0.2.6 → aixtools-0.2.8}/PKG-INFO +1 -1
  2. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/_version.py +3 -3
  3. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/a2a/google_sdk/pydantic_ai_adapter/agent_executor.py +3 -3
  4. aixtools-0.2.8/aixtools/a2a/google_sdk/utils.py +90 -0
  5. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools.egg-info/SOURCES.txt +0 -1
  6. aixtools-0.2.6/aixtools/a2a/google_sdk/card.py +0 -27
  7. aixtools-0.2.6/aixtools/a2a/google_sdk/utils.py +0 -59
  8. {aixtools-0.2.6 → aixtools-0.2.8}/README.md +0 -0
  9. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/config.toml +0 -0
  10. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/bn.json +0 -0
  11. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/en-US.json +0 -0
  12. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/gu.json +0 -0
  13. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/he-IL.json +0 -0
  14. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/hi.json +0 -0
  15. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/ja.json +0 -0
  16. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/kn.json +0 -0
  17. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/ml.json +0 -0
  18. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/mr.json +0 -0
  19. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/nl.json +0 -0
  20. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/ta.json +0 -0
  21. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/te.json +0 -0
  22. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/.chainlit/translations/zh-CN.json +0 -0
  23. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/__init__.py +0 -0
  24. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/a2a/app.py +0 -0
  25. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/a2a/google_sdk/__init__.py +0 -0
  26. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/a2a/google_sdk/pydantic_ai_adapter/storage.py +0 -0
  27. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/a2a/google_sdk/remote_agent_connection.py +0 -0
  28. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/a2a/utils.py +0 -0
  29. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/agents/__init__.py +0 -0
  30. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/agents/agent.py +0 -0
  31. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/agents/agent_batch.py +0 -0
  32. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/agents/print_nodes.py +0 -0
  33. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/agents/prompt.py +0 -0
  34. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/app.py +0 -0
  35. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/auth/__init__.py +0 -0
  36. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/auth/auth.py +0 -0
  37. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/chainlit.md +0 -0
  38. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/compliance/__init__.py +0 -0
  39. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/compliance/private_data.py +0 -0
  40. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/context.py +0 -0
  41. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/db/__init__.py +0 -0
  42. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/db/database.py +0 -0
  43. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/db/vector_db.py +0 -0
  44. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/evals/__init__.py +0 -0
  45. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/evals/__main__.py +0 -0
  46. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/evals/dataset.py +0 -0
  47. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/evals/discovery.py +0 -0
  48. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/evals/run_evals.py +0 -0
  49. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/google/client.py +0 -0
  50. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/__init__.py +0 -0
  51. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/app.py +0 -0
  52. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/display.py +0 -0
  53. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/export.py +0 -0
  54. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/filters.py +0 -0
  55. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/log_utils.py +0 -0
  56. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/log_view/node_summary.py +0 -0
  57. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logfilters/__init__.py +0 -0
  58. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logfilters/context_filter.py +0 -0
  59. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/__init__.py +0 -0
  60. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/log_objects.py +0 -0
  61. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/logging_config.py +0 -0
  62. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/mcp_log_models.py +0 -0
  63. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/mcp_logger.py +0 -0
  64. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/model_patch_logging.py +0 -0
  65. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/logging/open_telemetry.py +0 -0
  66. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/mcp/__init__.py +0 -0
  67. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/mcp/client.py +0 -0
  68. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/mcp/example_client.py +0 -0
  69. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/mcp/example_server.py +0 -0
  70. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/mcp/fast_mcp_log.py +0 -0
  71. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/mcp/faulty_mcp.py +0 -0
  72. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/model_patch/model_patch.py +0 -0
  73. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/server/__init__.py +0 -0
  74. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/server/app_mounter.py +0 -0
  75. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/server/path.py +0 -0
  76. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/server/utils.py +0 -0
  77. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/testing/__init__.py +0 -0
  78. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/testing/aix_test_model.py +0 -0
  79. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/testing/mock_tool.py +0 -0
  80. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/testing/model_patch_cache.py +0 -0
  81. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/tools/doctor/__init__.py +0 -0
  82. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/tools/doctor/mcp_tool_doctor.py +0 -0
  83. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/tools/doctor/tool_doctor.py +0 -0
  84. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/tools/doctor/tool_recommendation.py +0 -0
  85. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/__init__.py +0 -0
  86. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/chainlit/cl_agent_show.py +0 -0
  87. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/chainlit/cl_utils.py +0 -0
  88. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/config.py +0 -0
  89. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/config_util.py +0 -0
  90. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/enum_with_description.py +0 -0
  91. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/files.py +0 -0
  92. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/persisted_dict.py +0 -0
  93. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/utils/utils.py +0 -0
  94. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/vault/__init__.py +0 -0
  95. {aixtools-0.2.6 → aixtools-0.2.8}/aixtools/vault/vault.py +0 -0
  96. {aixtools-0.2.6 → aixtools-0.2.8}/pyproject.toml +0 -0
  97. {aixtools-0.2.6 → aixtools-0.2.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aixtools
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: Tools for AI exploration and debugging
5
5
  Requires-Python: >=3.11.2
6
6
  Description-Content-Type: text/markdown
@@ -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.6'
32
- __version_tuple__ = version_tuple = (0, 2, 6)
31
+ __version__ = version = '0.2.8'
32
+ __version_tuple__ = version_tuple = (0, 2, 8)
33
33
 
34
- __commit_id__ = commit_id = 'g9b369b8bb'
34
+ __commit_id__ = commit_id = 'gac214deb6'
@@ -158,7 +158,7 @@ class PydanticAgentExecutor(AgentExecutor):
158
158
  return
159
159
 
160
160
  for idx, artifact in enumerate(run_output.created_artifacts_paths):
161
- image_file = FileWithUri(uri=str(artifact), name=f"image_{idx}")
161
+ artifact_file = FileWithUri(uri=str(artifact), name=f"art_{idx}")
162
162
  await event_queue.enqueue_event(
163
163
  TaskArtifactUpdateEvent(
164
164
  append=False,
@@ -166,8 +166,8 @@ class PydanticAgentExecutor(AgentExecutor):
166
166
  task_id=task.id,
167
167
  last_chunk=True,
168
168
  artifact=Artifact(
169
- artifact_id=f"image_{idx}",
170
- parts=[Part(root=FilePart(file=image_file))],
169
+ artifact_id=f"art_{idx}",
170
+ parts=[Part(root=FilePart(file=artifact_file))],
171
171
  ),
172
172
  )
173
173
  )
@@ -0,0 +1,90 @@
1
+ """Utilities for handling A2A SDK agent cards and connections."""
2
+
3
+ import asyncio
4
+
5
+ import httpx
6
+ from a2a.client import A2ACardResolver, ClientConfig, ClientFactory
7
+ from a2a.server.agent_execution import RequestContext
8
+ from a2a.types import AgentCard
9
+ from a2a.utils import AGENT_CARD_WELL_KNOWN_PATH, PREV_AGENT_CARD_WELL_KNOWN_PATH
10
+
11
+ from aixtools.a2a.google_sdk.remote_agent_connection import RemoteAgentConnection
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
18
+
19
+
20
+ class AgentCardLoadFailedError(Exception):
21
+ pass
22
+
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
+
38
+ class _AgentCardResolver:
39
+ """Helper class to resolve and manage agent cards and their connections."""
40
+
41
+ def __init__(self, client: httpx.AsyncClient):
42
+ self._httpx_client = client
43
+ self._a2a_client_factory = ClientFactory(ClientConfig(httpx_client=self._httpx_client))
44
+ self.clients: dict[str, RemoteAgentConnection] = {}
45
+
46
+ def register_agent_card(self, card: AgentCard):
47
+ remote_connection = RemoteAgentConnection(card, self._a2a_client_factory.create(card))
48
+ self.clients[card.name] = remote_connection
49
+
50
+ async def retrieve_card(self, address: str):
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
58
+
59
+ async def get_a2a_clients(self, agent_hosts: list[str]) -> dict[str, RemoteAgentConnection]:
60
+ async with asyncio.TaskGroup() as task_group:
61
+ for address in agent_hosts:
62
+ task_group.create_task(self.retrieve_card(address))
63
+
64
+ return self.clients
65
+
66
+
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."""
71
+ headers = {
72
+ "user-id": ctx[0],
73
+ "session-id": ctx[1],
74
+ }
75
+ httpx_client = httpx.AsyncClient(headers=headers, timeout=timeout, follow_redirects=True)
76
+ return await _AgentCardResolver(httpx_client).get_a2a_clients(agent_hosts)
77
+
78
+
79
+ def card2description(card: AgentCard) -> str:
80
+ """Convert agent card to a description string."""
81
+ descr = f"{card.name}: {card.description}\n"
82
+ for skill in card.skills:
83
+ descr += f"\t - {skill.name}: {skill.description}\n"
84
+ return descr
85
+
86
+
87
+ def get_session_id_tuple(context: RequestContext) -> SessionIdTuple:
88
+ """Get the user_id, session_id tuple from the request context."""
89
+ headers = context.call_context.state.get("headers", {})
90
+ return headers.get("user-id", DEFAULT_USER_ID), headers.get("session-id", DEFAULT_SESSION_ID)
@@ -22,7 +22,6 @@ aixtools/.chainlit/translations/zh-CN.json
22
22
  aixtools/a2a/app.py
23
23
  aixtools/a2a/utils.py
24
24
  aixtools/a2a/google_sdk/__init__.py
25
- aixtools/a2a/google_sdk/card.py
26
25
  aixtools/a2a/google_sdk/remote_agent_connection.py
27
26
  aixtools/a2a/google_sdk/utils.py
28
27
  aixtools/a2a/google_sdk/pydantic_ai_adapter/agent_executor.py
@@ -1,27 +0,0 @@
1
- import httpx
2
- from a2a.client import A2ACardResolver
3
- from a2a.types import AgentCard
4
-
5
- from aixtools.logging.logging_config import get_logger
6
-
7
- logger = get_logger(__name__)
8
-
9
-
10
- async def get_agent_card(httpx_client: httpx.AsyncClient, agent_url: str) -> AgentCard:
11
- resolver = A2ACardResolver(
12
- httpx_client=httpx_client,
13
- base_url=agent_url,
14
- )
15
-
16
- try:
17
- _public_card = await resolver.get_agent_card() # Fetches from default public path
18
- logger.info("Successfully fetched public agent card:")
19
- logger.info(_public_card.model_dump_json(indent=2, exclude_none=True))
20
- final_agent_card_to_use = _public_card
21
- except Exception as e:
22
- logger.error(f"Critical error fetching public agent card: {e}", exc_info=True)
23
- raise RuntimeError("Failed to fetch the public agent card. Cannot continue.") from e
24
-
25
- # Set the URL which is accessible from the container
26
- final_agent_card_to_use.url = agent_url
27
- return final_agent_card_to_use
@@ -1,59 +0,0 @@
1
- import asyncio
2
-
3
- import httpx
4
- from a2a.client import A2ACardResolver, ClientConfig, ClientFactory
5
- from a2a.server.agent_execution import RequestContext
6
- from a2a.types import AgentCard
7
- from a2a.utils import AGENT_CARD_WELL_KNOWN_PATH, PREV_AGENT_CARD_WELL_KNOWN_PATH
8
-
9
- from aixtools.a2a.google_sdk.remote_agent_connection import RemoteAgentConnection
10
- from aixtools.context import DEFAULT_SESSION_ID, DEFAULT_USER_ID, SessionIdTuple
11
-
12
-
13
- class AgentCardLoadFailedError(Exception):
14
- pass
15
-
16
-
17
- class _AgentCardResolver:
18
- def __init__(self, client: httpx.AsyncClient):
19
- self._httpx_client = client
20
- self._a2a_client_factory = ClientFactory(ClientConfig(httpx_client=self._httpx_client))
21
- self.clients: dict[str, RemoteAgentConnection] = {}
22
-
23
- def register_agent_card(self, card: AgentCard):
24
- remote_connection = RemoteAgentConnection(card, self._a2a_client_factory.create(card))
25
- self.clients[card.name] = remote_connection
26
-
27
- async def retrieve_card(self, address: str):
28
- for card_path in [AGENT_CARD_WELL_KNOWN_PATH, PREV_AGENT_CARD_WELL_KNOWN_PATH]:
29
- try:
30
- card_resolver = A2ACardResolver(self._httpx_client, address, card_path)
31
- card = await card_resolver.get_agent_card()
32
- card.url = address
33
- self.register_agent_card(card)
34
- return
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}")
39
-
40
- async def get_a2a_clients(self, agent_hosts: list[str]) -> dict[str, RemoteAgentConnection]:
41
- async with asyncio.TaskGroup() as task_group:
42
- for address in agent_hosts:
43
- task_group.create_task(self.retrieve_card(address))
44
-
45
- return self.clients
46
-
47
-
48
- async def get_a2a_clients(ctx: SessionIdTuple, agent_hosts: list[str]) -> dict[str, RemoteAgentConnection]:
49
- headers = {
50
- "user-id": ctx[0],
51
- "session-id": ctx[1],
52
- }
53
- httpx_client = httpx.AsyncClient(headers=headers, timeout=60.0)
54
- return await _AgentCardResolver(httpx_client).get_a2a_clients(agent_hosts)
55
-
56
-
57
- def get_session_id_tuple(context: RequestContext) -> SessionIdTuple:
58
- headers = context.call_context.state.get("headers", {})
59
- 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