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.
- solace_agent_mesh/agent/adk/adk_llm.txt +182 -42
- solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +171 -0
- solace_agent_mesh/agent/adk/callbacks.py +165 -104
- solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +0 -18
- solace_agent_mesh/agent/adk/models/models_llm.txt +104 -55
- solace_agent_mesh/agent/adk/runner.py +25 -17
- solace_agent_mesh/agent/adk/services.py +3 -3
- solace_agent_mesh/agent/adk/setup.py +11 -0
- solace_agent_mesh/agent/adk/stream_parser.py +8 -1
- solace_agent_mesh/agent/adk/tool_wrapper.py +10 -3
- solace_agent_mesh/agent/agent_llm.txt +355 -18
- solace_agent_mesh/agent/protocol/event_handlers.py +460 -317
- solace_agent_mesh/agent/protocol/protocol_llm.txt +54 -7
- solace_agent_mesh/agent/sac/app.py +2 -2
- solace_agent_mesh/agent/sac/component.py +211 -517
- solace_agent_mesh/agent/sac/sac_llm.txt +133 -63
- solace_agent_mesh/agent/testing/testing_llm.txt +25 -58
- solace_agent_mesh/agent/tools/peer_agent_tool.py +15 -11
- solace_agent_mesh/agent/tools/tools_llm.txt +234 -69
- solace_agent_mesh/agent/utils/artifact_helpers.py +35 -1
- solace_agent_mesh/agent/utils/utils_llm.txt +90 -105
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/6e0db977.39a79ca9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{75384d09.ccd480c4.js → 75384d09.bf78fbdb.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/90dd9cf6.88f385ea.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.fb68323a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/main.08d30374.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.458efb1d.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +4 -4
- 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
- solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-technical-migration-map/index.html +53 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +4 -4
- solace_agent_mesh/assets/docs/lunr-index-1757433031159.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1757433031159.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/assets/docs/sitemap.xml +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +125 -48
- solace_agent_mesh/cli/commands/eval_cmd.py +14 -0
- solace_agent_mesh/cli/commands/init_cmd/__init__.py +53 -31
- solace_agent_mesh/cli/commands/init_cmd/database_step.py +91 -0
- solace_agent_mesh/cli/commands/init_cmd/env_step.py +19 -8
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +80 -25
- solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +32 -10
- solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +74 -15
- solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +0 -2
- solace_agent_mesh/cli/commands/run_cmd.py +5 -3
- solace_agent_mesh/cli/utils.py +68 -12
- solace_agent_mesh/client/webui/frontend/static/assets/authCallback-vY5eu2lI.js +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/client-BeBkzgWW.js +25 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-Bjys1KQs.js +339 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-C03yrETa.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/vendor-CE0AeXyK.js +395 -0
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -2
- solace_agent_mesh/client/webui/frontend/static/index.html +4 -3
- solace_agent_mesh/common/a2a/__init__.py +213 -0
- solace_agent_mesh/common/a2a/a2a_llm.txt +182 -0
- solace_agent_mesh/common/a2a/artifact.py +328 -0
- solace_agent_mesh/common/a2a/events.py +183 -0
- solace_agent_mesh/common/a2a/message.py +307 -0
- solace_agent_mesh/common/a2a/protocol.py +513 -0
- solace_agent_mesh/common/a2a/task.py +127 -0
- solace_agent_mesh/common/a2a/translation.py +653 -0
- solace_agent_mesh/common/a2a/types.py +54 -0
- solace_agent_mesh/common/a2a_spec/a2a.json +2576 -0
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +407 -0
- solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json +18 -0
- solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +31 -0
- solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +18 -0
- solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +235 -0
- solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json +26 -0
- solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +25 -0
- solace_agent_mesh/common/agent_registry.py +1 -1
- solace_agent_mesh/common/common_llm.txt +192 -70
- solace_agent_mesh/common/data_parts.py +99 -0
- solace_agent_mesh/common/middleware/middleware_llm.txt +17 -17
- solace_agent_mesh/common/sac/__init__.py +0 -0
- solace_agent_mesh/common/sac/sac_llm.txt +71 -0
- solace_agent_mesh/common/sac/sam_component_base.py +252 -0
- solace_agent_mesh/common/services/providers/providers_llm.txt +51 -84
- solace_agent_mesh/common/services/services_llm.txt +206 -26
- solace_agent_mesh/common/utils/artifact_utils.py +29 -0
- solace_agent_mesh/common/utils/embeds/embeds_llm.txt +176 -80
- solace_agent_mesh/common/utils/embeds/resolver.py +1 -0
- solace_agent_mesh/common/utils/utils_llm.txt +323 -42
- solace_agent_mesh/config_portal/backend/common.py +2 -2
- solace_agent_mesh/config_portal/backend/plugin_catalog/constants.py +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-bFMKlzKf.js +98 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-d845808d.js → manifest-89db7c30.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/index.html +1 -1
- solace_agent_mesh/core_a2a/core_a2a_llm.txt +10 -8
- solace_agent_mesh/core_a2a/service.py +20 -44
- solace_agent_mesh/evaluation/message_organizer.py +35 -56
- solace_agent_mesh/evaluation/run.py +26 -5
- solace_agent_mesh/evaluation/subscriber.py +35 -10
- solace_agent_mesh/evaluation/summary_builder.py +27 -34
- solace_agent_mesh/gateway/base/app.py +27 -1
- solace_agent_mesh/gateway/base/base_llm.txt +177 -72
- solace_agent_mesh/gateway/base/component.py +294 -523
- solace_agent_mesh/gateway/gateway_llm.txt +299 -58
- solace_agent_mesh/gateway/http_sse/ARCHITECTURE_GUIDE.md +676 -0
- solace_agent_mesh/gateway/http_sse/alembic/env.py +85 -0
- solace_agent_mesh/gateway/http_sse/alembic/script.py.mako +28 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/b1c2d3e4f5g6_add_database_indexes.py +83 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/d5b3f8f2e9a0_create_initial_database.py +58 -0
- solace_agent_mesh/gateway/http_sse/alembic.ini +147 -0
- solace_agent_mesh/gateway/http_sse/api/__init__.py +11 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/__init__.py +9 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/session_controller.py +355 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/task_controller.py +279 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/user_controller.py +35 -0
- solace_agent_mesh/gateway/http_sse/api/dto/__init__.py +10 -0
- solace_agent_mesh/gateway/http_sse/api/dto/requests/__init__.py +37 -0
- solace_agent_mesh/gateway/http_sse/api/dto/requests/session_requests.py +49 -0
- solace_agent_mesh/gateway/http_sse/api/dto/requests/task_requests.py +66 -0
- solace_agent_mesh/gateway/http_sse/api/dto/responses/__init__.py +43 -0
- solace_agent_mesh/gateway/http_sse/api/dto/responses/session_responses.py +68 -0
- solace_agent_mesh/gateway/http_sse/api/dto/responses/task_responses.py +74 -0
- solace_agent_mesh/gateway/http_sse/app.py +31 -1
- solace_agent_mesh/gateway/http_sse/application/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/application/services/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/application/services/session_service.py +135 -0
- solace_agent_mesh/gateway/http_sse/component.py +371 -236
- solace_agent_mesh/gateway/http_sse/components/components_llm.txt +29 -29
- solace_agent_mesh/gateway/http_sse/dependencies.py +142 -39
- solace_agent_mesh/gateway/http_sse/domain/entities/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/domain/entities/session.py +90 -0
- solace_agent_mesh/gateway/http_sse/domain/repositories/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/domain/repositories/session_repository.py +54 -0
- solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +272 -36
- solace_agent_mesh/gateway/http_sse/infrastructure/__init__.py +4 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/container.py +123 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/__init__.py +4 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_persistence_service.py +16 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_service.py +119 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/models.py +31 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence_service.py +12 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/repositories/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/repositories/session_repository.py +174 -0
- solace_agent_mesh/gateway/http_sse/main.py +293 -91
- solace_agent_mesh/gateway/http_sse/routers/agents.py +1 -1
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +137 -56
- solace_agent_mesh/gateway/http_sse/routers/config.py +3 -1
- solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +231 -5
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +199 -171
- solace_agent_mesh/gateway/http_sse/routers/visualization.py +7 -7
- solace_agent_mesh/gateway/http_sse/services/agent_service.py +1 -1
- solace_agent_mesh/gateway/http_sse/services/services_llm.txt +89 -135
- solace_agent_mesh/gateway/http_sse/services/task_service.py +2 -5
- solace_agent_mesh/gateway/http_sse/session_manager.py +64 -30
- solace_agent_mesh/gateway/http_sse/shared/__init__.py +9 -0
- solace_agent_mesh/gateway/http_sse/shared/auth_utils.py +29 -0
- solace_agent_mesh/gateway/http_sse/shared/enums.py +45 -0
- solace_agent_mesh/gateway/http_sse/shared/types.py +45 -0
- solace_agent_mesh/solace_agent_mesh_llm.txt +362 -0
- solace_agent_mesh/templates/gateway_component_template.py +149 -98
- solace_agent_mesh/templates/shared_config.yaml +4 -5
- solace_agent_mesh/templates/webui.yaml +8 -10
- {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/METADATA +9 -6
- {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/RECORD +197 -141
- solace_agent_mesh/assets/docs/assets/js/f284c35a.731836ad.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/main.3d0e7879.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.05d19492.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1757091012487.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1757091012487.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/authCallback-BmF2l6vg.js +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/client-D881Dttc.js +0 -49
- solace_agent_mesh/client/webui/frontend/static/assets/main-D0FnP_W4.css +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-Do32sFPX.js +0 -708
- solace_agent_mesh/common/a2a_protocol.py +0 -564
- solace_agent_mesh/common/client/__init__.py +0 -4
- solace_agent_mesh/common/client/card_resolver.py +0 -21
- solace_agent_mesh/common/client/client.py +0 -85
- solace_agent_mesh/common/client/client_llm.txt +0 -133
- solace_agent_mesh/common/server/__init__.py +0 -4
- solace_agent_mesh/common/server/server.py +0 -122
- solace_agent_mesh/common/server/server_llm.txt +0 -169
- solace_agent_mesh/common/server/task_manager.py +0 -291
- solace_agent_mesh/common/server/utils.py +0 -28
- solace_agent_mesh/common/types.py +0 -411
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-Bym6YkMd.js +0 -98
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +0 -80
- solace_agent_mesh/gateway/http_sse/routers/users.py +0 -59
- /solace_agent_mesh/assets/docs/assets/js/{main.3d0e7879.js.LICENSE.txt → main.08d30374.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/entry_points.txt +0 -0
- {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
|
|
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
|
|
6
|
-
- `audio_tools.py
|
|
7
|
-
- `builtin_artifact_tools.py
|
|
8
|
-
- `builtin_data_analysis_tools.py
|
|
9
|
-
- `general_agent_tools.py
|
|
10
|
-
- `image_tools.py
|
|
11
|
-
- `peer_agent_tool.py
|
|
12
|
-
- `registry.py
|
|
13
|
-
- `test_tools.py
|
|
14
|
-
- `tool_definition.py
|
|
15
|
-
- `web_tools.py
|
|
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:**
|
|
21
|
-
**Import:** `import
|
|
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
|
-
#
|
|
26
|
-
|
|
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
|
-
#
|
|
29
|
-
from
|
|
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:**
|
|
36
|
-
**Import:** `from
|
|
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
|
|
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
|
|
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]` -
|
|
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
|
|
43
|
-
- `transcribe_audio(audio_filename: str, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Transcribes
|
|
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
|
-
- `
|
|
47
|
-
- `
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
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
|
-
|
|
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
|
-
#
|
|
56
|
-
|
|
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=
|
|
74
|
+
tool_context=context,
|
|
75
|
+
tool_config={"gemini_api_key": "your_key"}
|
|
63
76
|
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
###
|
|
98
|
-
**Purpose:**
|
|
99
|
-
**Import:** `from
|
|
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
|
-
- `
|
|
103
|
-
- `
|
|
104
|
-
- `
|
|
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:
|