solace-agent-mesh 1.0.9__py3-none-any.whl → 1.3.0__py3-none-any.whl

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 solace-agent-mesh might be problematic. Click here for more details.

Files changed (220) hide show
  1. solace_agent_mesh/agent/adk/adk_llm.txt +182 -42
  2. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +171 -0
  3. solace_agent_mesh/agent/adk/callbacks.py +165 -104
  4. solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +0 -18
  5. solace_agent_mesh/agent/adk/models/models_llm.txt +104 -55
  6. solace_agent_mesh/agent/adk/runner.py +25 -17
  7. solace_agent_mesh/agent/adk/services.py +3 -3
  8. solace_agent_mesh/agent/adk/setup.py +11 -0
  9. solace_agent_mesh/agent/adk/stream_parser.py +8 -1
  10. solace_agent_mesh/agent/adk/tool_wrapper.py +10 -3
  11. solace_agent_mesh/agent/agent_llm.txt +355 -18
  12. solace_agent_mesh/agent/protocol/event_handlers.py +460 -317
  13. solace_agent_mesh/agent/protocol/protocol_llm.txt +54 -7
  14. solace_agent_mesh/agent/sac/app.py +2 -2
  15. solace_agent_mesh/agent/sac/component.py +211 -517
  16. solace_agent_mesh/agent/sac/sac_llm.txt +133 -63
  17. solace_agent_mesh/agent/testing/testing_llm.txt +25 -58
  18. solace_agent_mesh/agent/tools/peer_agent_tool.py +15 -11
  19. solace_agent_mesh/agent/tools/tools_llm.txt +234 -69
  20. solace_agent_mesh/agent/utils/artifact_helpers.py +35 -1
  21. solace_agent_mesh/agent/utils/utils_llm.txt +90 -105
  22. solace_agent_mesh/assets/docs/404.html +3 -3
  23. solace_agent_mesh/assets/docs/assets/js/6e0db977.39a79ca9.js +1 -0
  24. solace_agent_mesh/assets/docs/assets/js/{75384d09.ccd480c4.js → 75384d09.bf78fbdb.js} +1 -1
  25. solace_agent_mesh/assets/docs/assets/js/90dd9cf6.88f385ea.js +1 -0
  26. solace_agent_mesh/assets/docs/assets/js/f284c35a.fb68323a.js +1 -0
  27. solace_agent_mesh/assets/docs/assets/js/main.08d30374.js +2 -0
  28. solace_agent_mesh/assets/docs/assets/js/runtime~main.458efb1d.js +1 -0
  29. solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +4 -4
  30. solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +4 -4
  31. solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +4 -4
  32. solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +4 -4
  33. solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +4 -4
  34. solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +4 -4
  35. solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +4 -4
  36. solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +4 -4
  37. solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +4 -4
  38. solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +4 -4
  39. solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +4 -4
  40. solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +4 -4
  41. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +4 -4
  42. solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +4 -4
  43. solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +105 -0
  44. solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-technical-migration-map/index.html +53 -0
  45. solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +4 -4
  46. solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +4 -4
  47. solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +4 -4
  48. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +4 -4
  49. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +4 -4
  50. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +4 -4
  51. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +4 -4
  52. solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +4 -4
  53. solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +4 -4
  54. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +4 -4
  55. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +4 -4
  56. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +4 -4
  57. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +4 -4
  58. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +4 -4
  59. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +4 -4
  60. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +4 -4
  61. solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +4 -4
  62. solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +4 -4
  63. solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +4 -4
  64. solace_agent_mesh/assets/docs/lunr-index-1757433031159.json +1 -0
  65. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  66. solace_agent_mesh/assets/docs/search-doc-1757433031159.json +1 -0
  67. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  68. solace_agent_mesh/assets/docs/sitemap.xml +1 -1
  69. solace_agent_mesh/cli/__init__.py +1 -1
  70. solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +125 -48
  71. solace_agent_mesh/cli/commands/eval_cmd.py +14 -0
  72. solace_agent_mesh/cli/commands/init_cmd/__init__.py +53 -31
  73. solace_agent_mesh/cli/commands/init_cmd/database_step.py +91 -0
  74. solace_agent_mesh/cli/commands/init_cmd/env_step.py +19 -8
  75. solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +80 -25
  76. solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +32 -10
  77. solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +74 -15
  78. solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +0 -2
  79. solace_agent_mesh/cli/commands/run_cmd.py +5 -3
  80. solace_agent_mesh/cli/utils.py +68 -12
  81. solace_agent_mesh/client/webui/frontend/static/assets/authCallback-vY5eu2lI.js +1 -0
  82. solace_agent_mesh/client/webui/frontend/static/assets/client-BeBkzgWW.js +25 -0
  83. solace_agent_mesh/client/webui/frontend/static/assets/main-Bjys1KQs.js +339 -0
  84. solace_agent_mesh/client/webui/frontend/static/assets/main-C03yrETa.css +1 -0
  85. solace_agent_mesh/client/webui/frontend/static/assets/vendor-CE0AeXyK.js +395 -0
  86. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -2
  87. solace_agent_mesh/client/webui/frontend/static/index.html +4 -3
  88. solace_agent_mesh/common/a2a/__init__.py +213 -0
  89. solace_agent_mesh/common/a2a/a2a_llm.txt +182 -0
  90. solace_agent_mesh/common/a2a/artifact.py +328 -0
  91. solace_agent_mesh/common/a2a/events.py +183 -0
  92. solace_agent_mesh/common/a2a/message.py +307 -0
  93. solace_agent_mesh/common/a2a/protocol.py +513 -0
  94. solace_agent_mesh/common/a2a/task.py +127 -0
  95. solace_agent_mesh/common/a2a/translation.py +653 -0
  96. solace_agent_mesh/common/a2a/types.py +54 -0
  97. solace_agent_mesh/common/a2a_spec/a2a.json +2576 -0
  98. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +407 -0
  99. solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json +18 -0
  100. solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +31 -0
  101. solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +18 -0
  102. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +235 -0
  103. solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json +26 -0
  104. solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +25 -0
  105. solace_agent_mesh/common/agent_registry.py +1 -1
  106. solace_agent_mesh/common/common_llm.txt +192 -70
  107. solace_agent_mesh/common/data_parts.py +99 -0
  108. solace_agent_mesh/common/middleware/middleware_llm.txt +17 -17
  109. solace_agent_mesh/common/sac/__init__.py +0 -0
  110. solace_agent_mesh/common/sac/sac_llm.txt +71 -0
  111. solace_agent_mesh/common/sac/sam_component_base.py +252 -0
  112. solace_agent_mesh/common/services/providers/providers_llm.txt +51 -84
  113. solace_agent_mesh/common/services/services_llm.txt +206 -26
  114. solace_agent_mesh/common/utils/artifact_utils.py +29 -0
  115. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +176 -80
  116. solace_agent_mesh/common/utils/embeds/resolver.py +1 -0
  117. solace_agent_mesh/common/utils/utils_llm.txt +323 -42
  118. solace_agent_mesh/config_portal/backend/common.py +2 -2
  119. solace_agent_mesh/config_portal/backend/plugin_catalog/constants.py +1 -1
  120. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-bFMKlzKf.js +98 -0
  121. solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-d845808d.js → manifest-89db7c30.js} +1 -1
  122. solace_agent_mesh/config_portal/frontend/static/client/index.html +1 -1
  123. solace_agent_mesh/core_a2a/core_a2a_llm.txt +10 -8
  124. solace_agent_mesh/core_a2a/service.py +20 -44
  125. solace_agent_mesh/evaluation/message_organizer.py +35 -56
  126. solace_agent_mesh/evaluation/run.py +26 -5
  127. solace_agent_mesh/evaluation/subscriber.py +35 -10
  128. solace_agent_mesh/evaluation/summary_builder.py +27 -34
  129. solace_agent_mesh/gateway/base/app.py +27 -1
  130. solace_agent_mesh/gateway/base/base_llm.txt +177 -72
  131. solace_agent_mesh/gateway/base/component.py +294 -523
  132. solace_agent_mesh/gateway/gateway_llm.txt +299 -58
  133. solace_agent_mesh/gateway/http_sse/ARCHITECTURE_GUIDE.md +676 -0
  134. solace_agent_mesh/gateway/http_sse/alembic/env.py +85 -0
  135. solace_agent_mesh/gateway/http_sse/alembic/script.py.mako +28 -0
  136. solace_agent_mesh/gateway/http_sse/alembic/versions/b1c2d3e4f5g6_add_database_indexes.py +83 -0
  137. solace_agent_mesh/gateway/http_sse/alembic/versions/d5b3f8f2e9a0_create_initial_database.py +58 -0
  138. solace_agent_mesh/gateway/http_sse/alembic.ini +147 -0
  139. solace_agent_mesh/gateway/http_sse/api/__init__.py +11 -0
  140. solace_agent_mesh/gateway/http_sse/api/controllers/__init__.py +9 -0
  141. solace_agent_mesh/gateway/http_sse/api/controllers/session_controller.py +355 -0
  142. solace_agent_mesh/gateway/http_sse/api/controllers/task_controller.py +279 -0
  143. solace_agent_mesh/gateway/http_sse/api/controllers/user_controller.py +35 -0
  144. solace_agent_mesh/gateway/http_sse/api/dto/__init__.py +10 -0
  145. solace_agent_mesh/gateway/http_sse/api/dto/requests/__init__.py +37 -0
  146. solace_agent_mesh/gateway/http_sse/api/dto/requests/session_requests.py +49 -0
  147. solace_agent_mesh/gateway/http_sse/api/dto/requests/task_requests.py +66 -0
  148. solace_agent_mesh/gateway/http_sse/api/dto/responses/__init__.py +43 -0
  149. solace_agent_mesh/gateway/http_sse/api/dto/responses/session_responses.py +68 -0
  150. solace_agent_mesh/gateway/http_sse/api/dto/responses/task_responses.py +74 -0
  151. solace_agent_mesh/gateway/http_sse/app.py +31 -1
  152. solace_agent_mesh/gateway/http_sse/application/__init__.py +3 -0
  153. solace_agent_mesh/gateway/http_sse/application/services/__init__.py +3 -0
  154. solace_agent_mesh/gateway/http_sse/application/services/session_service.py +135 -0
  155. solace_agent_mesh/gateway/http_sse/component.py +371 -236
  156. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +29 -29
  157. solace_agent_mesh/gateway/http_sse/dependencies.py +142 -39
  158. solace_agent_mesh/gateway/http_sse/domain/entities/__init__.py +3 -0
  159. solace_agent_mesh/gateway/http_sse/domain/entities/session.py +90 -0
  160. solace_agent_mesh/gateway/http_sse/domain/repositories/__init__.py +3 -0
  161. solace_agent_mesh/gateway/http_sse/domain/repositories/session_repository.py +54 -0
  162. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +272 -36
  163. solace_agent_mesh/gateway/http_sse/infrastructure/__init__.py +4 -0
  164. solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/__init__.py +3 -0
  165. solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/container.py +123 -0
  166. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/__init__.py +4 -0
  167. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_persistence_service.py +16 -0
  168. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_service.py +119 -0
  169. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/models.py +31 -0
  170. solace_agent_mesh/gateway/http_sse/infrastructure/persistence_service.py +12 -0
  171. solace_agent_mesh/gateway/http_sse/infrastructure/repositories/__init__.py +3 -0
  172. solace_agent_mesh/gateway/http_sse/infrastructure/repositories/session_repository.py +174 -0
  173. solace_agent_mesh/gateway/http_sse/main.py +293 -91
  174. solace_agent_mesh/gateway/http_sse/routers/agents.py +1 -1
  175. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +137 -56
  176. solace_agent_mesh/gateway/http_sse/routers/config.py +3 -1
  177. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +231 -5
  178. solace_agent_mesh/gateway/http_sse/routers/tasks.py +199 -171
  179. solace_agent_mesh/gateway/http_sse/routers/visualization.py +7 -7
  180. solace_agent_mesh/gateway/http_sse/services/agent_service.py +1 -1
  181. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +89 -135
  182. solace_agent_mesh/gateway/http_sse/services/task_service.py +2 -5
  183. solace_agent_mesh/gateway/http_sse/session_manager.py +64 -30
  184. solace_agent_mesh/gateway/http_sse/shared/__init__.py +9 -0
  185. solace_agent_mesh/gateway/http_sse/shared/auth_utils.py +29 -0
  186. solace_agent_mesh/gateway/http_sse/shared/enums.py +45 -0
  187. solace_agent_mesh/gateway/http_sse/shared/types.py +45 -0
  188. solace_agent_mesh/solace_agent_mesh_llm.txt +362 -0
  189. solace_agent_mesh/templates/gateway_component_template.py +149 -98
  190. solace_agent_mesh/templates/shared_config.yaml +4 -5
  191. solace_agent_mesh/templates/webui.yaml +8 -10
  192. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/METADATA +9 -6
  193. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/RECORD +197 -141
  194. solace_agent_mesh/assets/docs/assets/js/f284c35a.731836ad.js +0 -1
  195. solace_agent_mesh/assets/docs/assets/js/main.3d0e7879.js +0 -2
  196. solace_agent_mesh/assets/docs/assets/js/runtime~main.05d19492.js +0 -1
  197. solace_agent_mesh/assets/docs/lunr-index-1757091012487.json +0 -1
  198. solace_agent_mesh/assets/docs/search-doc-1757091012487.json +0 -1
  199. solace_agent_mesh/client/webui/frontend/static/assets/authCallback-BmF2l6vg.js +0 -1
  200. solace_agent_mesh/client/webui/frontend/static/assets/client-D881Dttc.js +0 -49
  201. solace_agent_mesh/client/webui/frontend/static/assets/main-D0FnP_W4.css +0 -1
  202. solace_agent_mesh/client/webui/frontend/static/assets/main-Do32sFPX.js +0 -708
  203. solace_agent_mesh/common/a2a_protocol.py +0 -564
  204. solace_agent_mesh/common/client/__init__.py +0 -4
  205. solace_agent_mesh/common/client/card_resolver.py +0 -21
  206. solace_agent_mesh/common/client/client.py +0 -85
  207. solace_agent_mesh/common/client/client_llm.txt +0 -133
  208. solace_agent_mesh/common/server/__init__.py +0 -4
  209. solace_agent_mesh/common/server/server.py +0 -122
  210. solace_agent_mesh/common/server/server_llm.txt +0 -169
  211. solace_agent_mesh/common/server/task_manager.py +0 -291
  212. solace_agent_mesh/common/server/utils.py +0 -28
  213. solace_agent_mesh/common/types.py +0 -411
  214. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-Bym6YkMd.js +0 -98
  215. solace_agent_mesh/gateway/http_sse/routers/sessions.py +0 -80
  216. solace_agent_mesh/gateway/http_sse/routers/users.py +0 -59
  217. /solace_agent_mesh/assets/docs/assets/js/{main.3d0e7879.js.LICENSE.txt → main.08d30374.js.LICENSE.txt} +0 -0
  218. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/WHEEL +0 -0
  219. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/entry_points.txt +0 -0
  220. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,104 +1,269 @@
1
+ # DEVELOPER GUIDE for tools
2
+
1
3
  ## Quick Summary
2
- The `tools` directory contains the complete set of built-in tools available to the agent. It follows a declarative, registry-based pattern where each tool module defines its functions and registers them with a central `tool_registry`. This allows for automatic discovery and dynamic availability of tools based on configuration and agent capabilities. The tools cover a wide range of functionalities including artifact management, audio/image processing, data analysis, web requests, and inter-agent communication.
4
+ The `tools` directory contains the built-in tool system for the Solace Agent Mesh. It provides a declarative registry-based architecture for ADK tools including artifact management, audio processing, data analysis, image generation, web scraping, and peer agent communication. Tools follow a registry-based pattern where each module defines its functions and registers them with a central `tool_registry` for automatic discovery and dynamic availability.
3
5
 
4
6
  ## Files Overview
5
- - `__init__.py`: Imports all tool modules, triggering their registration with the central registry.
6
- - `audio_tools.py`: Provides tools for text-to-speech (TTS), multi-speaker TTS, audio concatenation, and transcription.
7
- - `builtin_artifact_tools.py`: Contains core tools for creating, listing, loading, modifying, and deleting artifacts.
8
- - `builtin_data_analysis_tools.py`: Offers tools for generating charts from Plotly configurations.
9
- - `general_agent_tools.py`: Includes general-purpose utilities like file-to-markdown conversion and Mermaid diagram generation.
10
- - `image_tools.py`: Provides tools for image generation, editing, and vision-based description of images and audio.
11
- - `peer_agent_tool.py`: Defines the `PeerAgentTool` class for delegating tasks to other agents.
12
- - `registry.py`: Implements the singleton `tool_registry` for managing all tool definitions.
13
- - `test_tools.py`: Contains tools specifically for testing agent behavior, such as delays and failures.
14
- - `tool_definition.py`: Defines the `BuiltinTool` Pydantic model used for declaring tools.
15
- - `web_tools.py`: Contains a tool for making HTTP requests to external web resources.
7
+ - `__init__.py` - Imports all tool modules to trigger declarative registration
8
+ - `audio_tools.py` - Text-to-speech, voice selection, audio concatenation and transcription tools
9
+ - `builtin_artifact_tools.py` - Artifact CRUD operations, content extraction, and embed processing
10
+ - `builtin_data_analysis_tools.py` - Plotly chart generation from JSON/YAML configs
11
+ - `general_agent_tools.py` - File conversion (MarkItDown), Mermaid diagram generation
12
+ - `image_tools.py` - Image generation, description, editing with various APIs
13
+ - `peer_agent_tool.py` - Dynamic tool for delegating tasks to peer agents
14
+ - `registry.py` - Singleton registry for tool discovery and management
15
+ - `test_tools.py` - Testing utilities (delays, failures, dangling calls)
16
+ - `tool_definition.py` - Pydantic model for tool definitions
17
+ - `web_tools.py` - Web scraping and content extraction tools
16
18
 
17
19
  ## Developer API Reference
18
20
 
19
21
  ### __init__.py
20
- **Purpose:** This file ensures that all built-in tool modules are imported when the `tools` package is loaded. This is crucial for the declarative tool registration pattern, as it triggers the `tool_registry.register()` calls within each tool module.
21
- **Import:** `import src.solace_agent_mesh.agent.tools`
22
+ **Purpose:** Ensures all tool modules are imported to trigger declarative registration
23
+ **Import:** `from solace_agent_mesh.agent.tools import *` or `import solace_agent_mesh.agent.tools`
22
24
 
23
25
  **Usage Examples:**
24
26
  ```python
25
- # Importing the tools package is sufficient to register all built-in tools.
26
- import src.solace_agent_mesh.agent.tools
27
+ # Import triggers registration of all tools
28
+ from solace_agent_mesh.agent.tools import *
29
+
30
+ # Or import the package to register all tools
31
+ import solace_agent_mesh.agent.tools
27
32
 
28
- # You can then access the registry to see all registered tools.
29
- from src.solace_agent_mesh.agent.tools.registry import tool_registry
33
+ # Access the registry to see all registered tools
34
+ from solace_agent_mesh.agent.tools.registry import tool_registry
30
35
  all_tools = tool_registry.get_all_tools()
31
- print(f"Registered {len(all_tools)} tools.")
36
+ print(f"Registered {len(all_tools)} tools")
32
37
  ```
33
38
 
34
39
  ### audio_tools.py
35
- **Purpose:** This file provides a collection of tools for audio processing, including text-to-speech (TTS) generation, audio concatenation, and transcription.
36
- **Import:** `from src.solace_agent_mesh.agent.tools.audio_tools import select_voice, text_to_speech, multi_speaker_text_to_speech, concatenate_audio, transcribe_audio`
40
+ **Purpose:** Audio processing tools for TTS, voice selection, and transcription
41
+ **Import:** `from solace_agent_mesh.agent.tools.audio_tools import select_voice, text_to_speech, multi_speaker_text_to_speech, concatenate_audio, transcribe_audio`
37
42
 
38
43
  **Functions:**
39
- - `select_voice(gender: Optional[str] = None, tone: Optional[str] = None, exclude_voices: Optional[List[str]] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Selects a suitable voice name based on criteria like gender and tone. Use this to get a consistent voice name that can be passed to the `text_to_speech` tool for multiple calls.
40
- - `text_to_speech(text: str, output_filename: Optional[str] = None, voice_name: Optional[str] = None, gender: Optional[str] = None, tone: Optional[str] = None, language: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Converts text to speech using Gemini TTS API and saves as an MP3 artifact.
41
- - `multi_speaker_text_to_speech(conversation_text: str, output_filename: Optional[str] = None, speaker_configs: Optional[List[Dict[str, str]]] = None, language: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Converts conversation text with speaker labels to speech using multiple voices.
42
- - `concatenate_audio(clips_to_join: List[Dict[str, Any]], output_filename: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Combines multiple audio artifacts in a specified order into a single audio file, with optional pauses.
43
- - `transcribe_audio(audio_filename: str, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Transcribes an audio recording using an OpenAI-compatible audio transcription API.
44
+ - `select_voice(gender: Optional[str] = None, tone: Optional[str] = None, exclude_voices: Optional[List[str]] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Selects a voice based on gender/tone criteria
45
+ - `text_to_speech(text: str, output_filename: Optional[str] = None, voice_name: Optional[str] = None, gender: Optional[str] = None, tone: Optional[str] = None, language: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Converts text to speech using Gemini TTS
46
+ - `multi_speaker_text_to_speech(conversation_text: str, output_filename: Optional[str] = None, speaker_configs: Optional[List[Dict[str, str]]] = None, language: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Multi-speaker TTS for conversations
47
+ - `concatenate_audio(clips_to_join: List[Dict[str, Any]], output_filename: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Combines multiple audio clips with custom pauses
48
+ - `transcribe_audio(audio_filename: str, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Transcribes audio using OpenAI-compatible API
44
49
 
45
50
  **Constants/Variables:**
46
- - `ALL_AVAILABLE_VOICES: List[str]` - A list of all available voice names for TTS.
47
- - `SUPPORTED_LANGUAGES: Dict[str, str]` - A mapping of common language names to their BCP-47 codes.
48
- - `VOICE_TONE_MAPPING: Dict[str, List[str]]` - A dictionary mapping descriptive tones to lists of voice names.
49
- - `GENDER_TO_VOICE_MAPPING: Dict[str, List[str]]` - A dictionary mapping genders ('male', 'female', 'neutral') to lists of voice names.
51
+ - `VOICE_TONE_MAPPING: Dict[str, List[str]]` - Maps tones to available voices
52
+ - `GENDER_TO_VOICE_MAPPING: Dict[str, List[str]]` - Maps genders to available voices
53
+ - `ALL_AVAILABLE_VOICES: List[str]` - Complete list of available voice names
54
+ - `SUPPORTED_LANGUAGES: Dict[str, str]` - Maps language names to BCP-47 codes
55
+ - `DEFAULT_VOICE: str` - Default voice name ("Kore")
50
56
 
51
57
  **Usage Examples:**
52
58
  ```python
53
- # Assume 'tool_context' is a valid ToolContext object.
59
+ from google.adk.tools import ToolContext
60
+ from solace_agent_mesh.agent.tools.audio_tools import text_to_speech, select_voice
54
61
 
55
- # 1. Generate a simple audio file
56
- tts_result = await text_to_speech(
57
- text="Welcome to the developer guide.",
58
- output_filename="welcome.mp3",
62
+ # Select a voice with specific criteria
63
+ voice_result = await select_voice(
59
64
  gender="female",
60
65
  tone="friendly",
66
+ tool_context=context
67
+ )
68
+
69
+ # Convert text to speech
70
+ result = await text_to_speech(
71
+ text="Hello world",
72
+ voice_name="Kore",
61
73
  language="en-US",
62
- tool_context=tool_context
74
+ tool_context=context,
75
+ tool_config={"gemini_api_key": "your_key"}
63
76
  )
64
- print(tts_result)
65
-
66
- # 2. Generate a multi-speaker conversation
67
- convo_result = await multi_speaker_text_to_speech(
68
- conversation_text="SpeakerA: How are you?\nSpeakerB: I am fine, thank you.",
69
- speaker_configs=[
70
- {"name": "SpeakerA", "gender": "male", "tone": "warm"},
71
- {"name": "SpeakerB", "gender": "female", "tone": "bright"}
72
- ],
73
- output_filename="dialogue.mp3",
74
- tool_context=tool_context
77
+ ```
78
+
79
+ ### builtin_artifact_tools.py
80
+ **Purpose:** Comprehensive artifact management and content processing tools
81
+ **Import:** `from solace_agent_mesh.agent.tools.builtin_artifact_tools import list_artifacts, load_artifact, signal_artifact_for_return, apply_embed_and_create_artifact, extract_content_from_artifact, append_to_artifact, delete_artifact`
82
+
83
+ **Functions:**
84
+ - `list_artifacts(tool_context: ToolContext = None) -> Dict[str, Any]` - Lists all artifacts with metadata summaries
85
+ - `load_artifact(filename: str, version: int, load_metadata_only: bool = False, max_content_length: Optional[int] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Loads artifact content or metadata
86
+ - `signal_artifact_for_return(filename: str, version: int, tool_context: ToolContext = None) -> Dict[str, Any]` - Signals artifact for return to caller
87
+ - `apply_embed_and_create_artifact(output_filename: str, embed_directive: str, output_metadata: Optional[Dict[str, Any]] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Resolves embeds and creates new artifacts
88
+ - `extract_content_from_artifact(filename: str, extraction_goal: str, version: Optional[str] = "latest", output_filename_base: Optional[str] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Uses LLM to extract/transform artifact content
89
+ - `append_to_artifact(filename: str, content_chunk: str, mime_type: str, tool_context: ToolContext = None) -> Dict[str, Any]` - Appends content to existing artifacts
90
+ - `delete_artifact(filename: str, version: Optional[int] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Deletes artifact versions
91
+
92
+ **Usage Examples:**
93
+ ```python
94
+ from solace_agent_mesh.agent.tools.builtin_artifact_tools import load_artifact, list_artifacts
95
+
96
+ # List all artifacts
97
+ artifacts = await list_artifacts(tool_context=context)
98
+
99
+ # Load latest version of an artifact
100
+ result = await load_artifact(
101
+ filename="data.csv",
102
+ version=1,
103
+ load_metadata_only=False,
104
+ tool_context=context
75
105
  )
76
- print(convo_result)
77
-
78
- # 3. Concatenate the generated audio files
79
- concat_result = await concatenate_audio(
80
- clips_to_join=[
81
- {"filename": "welcome.mp3:1", "pause_after_ms": 500},
82
- {"filename": "dialogue.mp3:1"}
83
- ],
84
- output_filename="combined_audio.mp3",
85
- tool_context=tool_context
106
+
107
+ # Extract content using LLM
108
+ extracted = await extract_content_from_artifact(
109
+ filename="document.pdf",
110
+ extraction_goal="Extract all email addresses",
111
+ tool_context=context
86
112
  )
87
- print(concat_result)
113
+ ```
114
+
115
+ ### builtin_data_analysis_tools.py
116
+ **Purpose:** Data visualization and chart generation tools
117
+ **Import:** `from solace_agent_mesh.agent.tools.builtin_data_analysis_tools import create_chart_from_plotly_config`
118
+
119
+ **Functions:**
120
+ - `create_chart_from_plotly_config(config_content: str, config_format: Literal["json", "yaml"], output_filename: str, output_format: Optional[str] = "png", tool_context: ToolContext = None) -> Dict[str, Any]` - Generates charts from Plotly configurations
88
121
 
89
- # 4. Transcribe the combined audio
90
- transcribe_result = await transcribe_audio(
91
- audio_filename="combined_audio.mp3:1",
92
- tool_context=tool_context
122
+ **Usage Examples:**
123
+ ```python
124
+ from solace_agent_mesh.agent.tools.builtin_data_analysis_tools import create_chart_from_plotly_config
125
+
126
+ # Create chart from JSON config
127
+ result = await create_chart_from_plotly_config(
128
+ config_content='{"data": [{"x": [1,2,3], "y": [4,5,6], "type": "scatter"}]}',
129
+ config_format="json",
130
+ output_filename="chart.png",
131
+ tool_context=context
93
132
  )
94
- print(transcribe_result)
95
133
  ```
96
134
 
97
- ### builtin_artifact_tools.py
98
- **Purpose:** This file provides the core tools for artifact management, allowing the agent to create, read, list, update, and delete data artifacts within the current session.
99
- **Import:** `from src.solace_agent_mesh.agent.tools.builtin_artifact_tools import list_artifacts, load_artifact, signal_artifact_for_return, append_to_artifact, apply_embed_and_create_artifact, extract_content_from_artifact, delete_artifact`
135
+ ### general_agent_tools.py
136
+ **Purpose:** General utility tools for file conversion and diagram generation
137
+ **Import:** `from solace_agent_mesh.agent.tools.general_agent_tools import convert_file_to_markdown, mermaid_diagram_generator`
138
+
139
+ **Functions:**
140
+ - `convert_file_to_markdown(input_filename: str, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Converts files to Markdown using MarkItDown
141
+ - `mermaid_diagram_generator(mermaid_syntax: str, output_filename: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Generates PNG diagrams from Mermaid syntax
142
+
143
+ **Usage Examples:**
144
+ ```python
145
+ from solace_agent_mesh.agent.tools.general_agent_tools import mermaid_diagram_generator, convert_file_to_markdown
146
+
147
+ # Convert PDF to Markdown
148
+ markdown_result = await convert_file_to_markdown(
149
+ input_filename="document.pdf",
150
+ tool_context=context
151
+ )
152
+
153
+ # Generate diagram from Mermaid syntax
154
+ result = await mermaid_diagram_generator(
155
+ mermaid_syntax="graph TD; A-->B; B-->C;",
156
+ output_filename="diagram.png",
157
+ tool_context=context
158
+ )
159
+ ```
160
+
161
+ ### image_tools.py
162
+ **Purpose:** Image generation, description, and editing capabilities
163
+ **Import:** `from solace_agent_mesh.agent.tools.image_tools import create_image_from_description, describe_image, describe_audio, edit_image_with_gemini`
100
164
 
101
165
  **Functions:**
102
- - `list_artifacts(tool_context: ToolContext = None) -> Dict[str, Any]` - Lists all available data artifact filenames and their versions for the current session.
103
- - `load_artifact(filename: str, version: int, load_metadata_only: bool = False, max_content_length: Optional[int] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Loads the content or metadata of a specific artifact version.
104
- - `signal_artifact_for_return(filename: str, version: int, tool_context: ToolContext = None
166
+ - `create_image_from_description(image_description: str, output_filename: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Generates images from text descriptions
167
+ - `describe_image(image_filename: str, prompt: str = "What is in this image?", tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Describes images using vision APIs
168
+ - `describe_audio(audio_filename: str, prompt: str = "What is in this recording?", tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Describes audio using multimodal APIs
169
+ - `edit_image_with_gemini(image_filename: str, edit_prompt: str, output_filename: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Edits images using Gemini
170
+
171
+ **Usage Examples:**
172
+ ```python
173
+ from solace_agent_mesh.agent.tools.image_tools import create_image_from_description, describe_image
174
+
175
+ # Generate image from description
176
+ result = await create_image_from_description(
177
+ image_description="A sunset over mountains",
178
+ output_filename="sunset.png",
179
+ tool_context=context,
180
+ tool_config={"model": "dall-e-3", "api_key": "key", "api_base": "url"}
181
+ )
182
+
183
+ # Describe an image
184
+ description = await describe_image(
185
+ image_filename="photo.jpg",
186
+ prompt="What objects are in this image?",
187
+ tool_context=context,
188
+ tool_config={"model": "gpt-4-vision", "api_key": "key", "api_base": "url"}
189
+ )
190
+ ```
191
+
192
+ ### peer_agent_tool.py
193
+ **Purpose:** Dynamic tool for delegating tasks to peer agents
194
+ **Import:** `from solace_agent_mesh.agent.tools.peer_agent_tool import PeerAgentTool, ArtifactIdentifier`
195
+
196
+ **Classes:**
197
+ - `ArtifactIdentifier(filename: str, version: Union[str, int] = "latest")` - Identifies specific artifact versions
198
+ - `PeerAgentTool(target_agent_name: str, host_component)` - Tool for delegating to specific peer agents
199
+ - `run_async(args: Dict[str, Any], tool_context: ToolContext) -> Any` - Executes peer delegation
200
+ - `is_long_running: bool` - Always True for async delegation
201
+
202
+ **Usage Examples:**
203
+ ```python
204
+ from solace_agent_mesh.agent.tools.peer_agent_tool import PeerAgentTool, ArtifactIdentifier
205
+
206
+ # Create tool for specific peer agent (typically done automatically)
207
+ peer_tool = PeerAgentTool("data_analyst", host_component)
208
+
209
+ # Use in agent tool registry
210
+ result = await peer_tool.run_async(
211
+ args={"task_description": "Analyze this data", "artifacts": [{"filename": "data.csv"}]},
212
+ tool_context=context
213
+ )
214
+
215
+ # Artifact identifier usage
216
+ artifact_id = ArtifactIdentifier("report.pdf", version=2)
217
+ ```
218
+
219
+ ### registry.py
220
+ **Purpose:** Singleton registry for tool discovery and management
221
+ **Import:** `from solace_agent_mesh.agent.tools.registry import tool_registry`
222
+
223
+ **Classes:**
224
+ - `_ToolRegistry()` - Singleton registry for built-in tools
225
+ - `register(tool: BuiltinTool) -> None` - Registers a tool definition
226
+ - `get_tool_by_name(name: str) -> Optional[BuiltinTool]` - Retrieves tool by name
227
+ - `get_tools_by_category(category_name: str) -> List[BuiltinTool]` - Gets tools by category
228
+ - `get_all_tools() -> List[BuiltinTool]` - Returns all registered tools
229
+ - `clear() -> None` - Clears registry (testing only)
230
+
231
+ **Constants/Variables:**
232
+ - `tool_registry: _ToolRegistry` - Global singleton instance
233
+
234
+ **Usage Examples:**
235
+ ```python
236
+ from solace_agent_mesh.agent.tools.registry import tool_registry
237
+ from solace_agent_mesh.agent.tools.tool_definition import BuiltinTool
238
+
239
+ # Get all registered tools
240
+ all_tools = tool_registry.get_all_tools()
241
+ print(f"Total tools: {len(all_tools)}")
242
+
243
+ # Register a new tool
244
+ tool_registry.register(my_tool_def)
245
+
246
+ # Get tool by name
247
+ tool = tool_registry.get_tool_by_name("my_tool")
248
+
249
+ # Get all audio tools
250
+ audio_tools = tool_registry.get_tools_by_category("audio")
251
+ ```
252
+
253
+ ### test_tools.py
254
+ **Purpose:** Testing utilities for tool behavior validation
255
+ **Import:** `from solace_agent_mesh.agent.tools.test_tools import time_delay, always_fail_tool, dangling_tool_call_test_tool`
256
+
257
+ **Functions:**
258
+ - `time_delay(seconds: float, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Pauses execution for testing
259
+ - `always_fail_tool() -> dict` - Always raises exception for error testing
260
+ - `dangling_tool_call_test_tool() -> None` - Returns None to test history repair
261
+
262
+ **Usage Examples:**
263
+ ```python
264
+ from solace_agent_mesh.agent.tools.test_tools import time_delay
265
+
266
+ # Add delay for testing
267
+ result = await time_delay(
268
+
269
+ # content_hash: f7491febb2c839b6bcdea784c843205240da0fea5de565d830fef6a544524875
@@ -13,10 +13,11 @@ import yaml
13
13
  import traceback
14
14
  from datetime import datetime, timezone
15
15
  from typing import Any, Dict, Optional, Tuple, List, Union, TYPE_CHECKING
16
+ from urllib.parse import urlparse, parse_qs, urlunparse, urlencode
16
17
  from google.adk.artifacts import BaseArtifactService
17
18
  from google.genai import types as adk_types
18
19
  from solace_ai_connector.common.log import log
19
- from ...common.types import ArtifactInfo
20
+ from ...common.a2a.types import ArtifactInfo
20
21
  from ...common.utils.mime_helpers import is_text_based_mime_type, is_text_based_file
21
22
  from ...agent.utils.context_helpers import get_original_session_id
22
23
 
@@ -85,6 +86,39 @@ def ensure_correct_extension(filename_from_llm: str, desired_extension: str) ->
85
86
  return f"{base_name}.{desired_ext_clean}"
86
87
 
87
88
 
89
+ def format_artifact_uri(
90
+ app_name: str, user_id: str, session_id: str, filename: str, version: Union[int, str]
91
+ ) -> str:
92
+ """Formats the components into a standard artifact:// URI."""
93
+ path = f"/{user_id}/{session_id}/{filename}"
94
+ query = urlencode({"version": str(version)})
95
+ return urlunparse(("artifact", app_name, path, "", query, ""))
96
+
97
+
98
+ def parse_artifact_uri(uri: str) -> Dict[str, Any]:
99
+ """Parses an artifact:// URI into its constituent parts."""
100
+ parsed = urlparse(uri)
101
+ if parsed.scheme != "artifact":
102
+ raise ValueError("Invalid URI scheme, must be 'artifact'.")
103
+
104
+ path_parts = parsed.path.strip("/").split("/")
105
+ if len(path_parts) != 3:
106
+ raise ValueError("Invalid URI path. Expected /user_id/session_id/filename")
107
+
108
+ query_params = parse_qs(parsed.query)
109
+ version = query_params.get("version", [None])[0]
110
+ if not version:
111
+ raise ValueError("Version is missing from URI query parameters.")
112
+
113
+ return {
114
+ "app_name": parsed.netloc,
115
+ "user_id": path_parts[0],
116
+ "session_id": path_parts[1],
117
+ "filename": path_parts[2],
118
+ "version": int(version) if version.isdigit() else version,
119
+ }
120
+
121
+
88
122
  def _inspect_structure(
89
123
  data: Any, max_depth: int, max_keys: int, current_depth: int = 0
90
124
  ) -> Any: