solace-agent-mesh 1.6.2__py3-none-any.whl → 1.7.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 +12 -18
- solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +1 -1
- solace_agent_mesh/agent/adk/callbacks.py +138 -20
- solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +2 -0
- solace_agent_mesh/agent/adk/models/lite_llm.py +38 -5
- solace_agent_mesh/agent/adk/models/models_llm.txt +82 -35
- solace_agent_mesh/agent/adk/runner.py +9 -0
- solace_agent_mesh/agent/adk/services.py +3 -3
- solace_agent_mesh/agent/adk/stream_parser.py +6 -1
- solace_agent_mesh/agent/adk/tool_wrapper.py +3 -0
- solace_agent_mesh/agent/agent_llm.txt +61 -70
- solace_agent_mesh/agent/protocol/event_handlers.py +29 -1
- solace_agent_mesh/agent/protocol/protocol_llm.txt +1 -1
- solace_agent_mesh/agent/proxies/a2a/a2a_llm.txt +190 -0
- solace_agent_mesh/agent/proxies/base/base_llm.txt +148 -0
- solace_agent_mesh/agent/proxies/proxies_llm.txt +283 -0
- solace_agent_mesh/agent/sac/app.py +22 -0
- solace_agent_mesh/agent/sac/component.py +76 -40
- solace_agent_mesh/agent/sac/sac_llm.txt +1 -1
- solace_agent_mesh/agent/sac/task_execution_context.py +21 -0
- solace_agent_mesh/agent/testing/testing_llm.txt +2 -1
- solace_agent_mesh/agent/tools/builtin_artifact_tools.py +13 -148
- solace_agent_mesh/agent/tools/dynamic_tool.py +2 -0
- solace_agent_mesh/agent/tools/tools_llm.txt +93 -80
- solace_agent_mesh/agent/tools/tools_llm_detail.txt +3 -2
- solace_agent_mesh/agent/utils/artifact_helpers.py +4 -0
- solace_agent_mesh/agent/utils/utils_llm.txt +16 -2
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/05749d90.c70b2be9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/15ba94aa.92fea363.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/15e40e79.36003774.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2987107d.a80604f9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3ac1795d.e4870a49.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3ff0015d.b63ee53a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/547e15cc.2f7790c1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5c2bd65f.45b32c2b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/631738c7.fa471607.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/64195356.c498c4d0.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6a520c9d.b6e3f2ce.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.a5b36a60.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/71da7b71.374b9d54.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8024126c.fa0e7186.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8b032486.91a91afc.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/94e8668d.09ed9234.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{ab9708a8.3e6dd091.js → ab9708a8.245ae0ef.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/ad87452a.9d73dad6.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.f902fad8.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/da0b5bad.b62f7b08.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/db5d6442.3daf1696.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/dd817ffc.c37a755e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/dd81e2b8.b682e9c2.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/de915948.44a432bc.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e04b235d.c9c50c7b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e3d9abda.d11c67a7.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{e6f9706b.e74a984d.js → e6f9706b.045d0fa1.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/e92d0134.3bda61dd.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.5099c51e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ff4d71f2.74710fc1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/main.e6488e8b.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.d9606d6a.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/artifact-management/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/audio-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/data-analysis-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/embeds/index.html +18 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/cli/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/gateways/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/components/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/orchestrator/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/plugins/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/projects/index.html +196 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/proxies/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deploying/debugging/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/deploying/deployment-options/index.html +6 -7
- solace_agent_mesh/assets/docs/docs/documentation/deploying/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes-deployment/index.html +47 -0
- solace_agent_mesh/assets/docs/docs/documentation/deploying/logging/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deploying/observability/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/create-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/create-gateways/index.html +160 -169
- solace_agent_mesh/assets/docs/docs/documentation/developing/creating-python-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/creating-service-providers/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/evaluations/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/structure/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/bedrock-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/custom-agent/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/event-mesh-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mcp-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mongodb-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rag-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rest-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/slack-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/sql-database/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/agent-builder/index.html +59 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/connectors/index.html +62 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +10 -6
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/rbac-setup-guide/index.html +24 -29
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/secure-user-delegated-access/index.html +440 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/single-sign-on/index.html +27 -4
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/wheel-installation/index.html +62 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/architecture/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/index.html +5 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/try-agent-mesh/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/artifact-storage/index.html +290 -0
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/configurations/index.html +9 -9
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/large_language_models/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/run-project/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/session-storage/index.html +251 -0
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/user-feedback/index.html +88 -0
- solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-gateway-upgrade-to-0.3.0/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-technical-migration-map/index.html +3 -3
- solace_agent_mesh/assets/docs/lunr-index-1762189824009.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1762189824009.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/docs_cmd.py +4 -1
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-D4_RMYRh.js → authCallback-tcIFZLis.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/{client-UZ3qU6Bq.js → client-CRYdKo2Q.js} +3 -3
- solace_agent_mesh/client/webui/frontend/static/assets/main-CojeY_1w.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-ILja9MCG.js +353 -0
- solace_agent_mesh/client/webui/frontend/static/assets/vendor-CINwxvwV.js +470 -0
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
- solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
- solace_agent_mesh/common/a2a/a2a_llm.txt +13 -20
- solace_agent_mesh/common/a2a/protocol.py +5 -0
- solace_agent_mesh/common/a2a/types.py +1 -0
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +49 -11
- solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +23 -6
- solace_agent_mesh/common/a2a_spec/schemas/feedback_event.json +51 -0
- solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +26 -9
- solace_agent_mesh/common/common_llm.txt +13 -34
- solace_agent_mesh/common/data_parts.py +20 -4
- solace_agent_mesh/common/middleware/middleware_llm.txt +1 -1
- solace_agent_mesh/common/sac/sac_llm.txt +1 -1
- solace_agent_mesh/common/sam_events/sam_events_llm.txt +1 -1
- solace_agent_mesh/common/services/employee_service.py +1 -1
- solace_agent_mesh/common/services/providers/providers_llm.txt +3 -2
- solace_agent_mesh/common/services/services_llm.txt +9 -4
- solace_agent_mesh/common/utils/embeds/constants.py +1 -0
- solace_agent_mesh/common/utils/embeds/embeds_llm.txt +1 -1
- solace_agent_mesh/common/utils/embeds/modifiers.py +2 -1
- solace_agent_mesh/common/utils/embeds/resolver.py +58 -6
- solace_agent_mesh/common/utils/embeds/types.py +8 -0
- solace_agent_mesh/common/utils/utils_llm.txt +5 -6
- solace_agent_mesh/core_a2a/core_a2a_llm.txt +1 -1
- solace_agent_mesh/gateway/adapter/__init__.py +1 -0
- solace_agent_mesh/gateway/adapter/base.py +143 -0
- solace_agent_mesh/gateway/adapter/types.py +221 -0
- solace_agent_mesh/gateway/base/app.py +29 -2
- solace_agent_mesh/gateway/base/base_llm.txt +10 -8
- solace_agent_mesh/gateway/base/component.py +573 -142
- solace_agent_mesh/gateway/gateway_llm.txt +55 -59
- solace_agent_mesh/gateway/generic/__init__.py +1 -0
- solace_agent_mesh/gateway/generic/app.py +50 -0
- solace_agent_mesh/gateway/generic/component.py +650 -0
- solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +99 -49
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_fulltext_search_indexes.py +92 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_project_users_table.py +72 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_soft_delete_and_search.py +150 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_default_agent_to_projects.py +26 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_projects_table.py +135 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +26 -20
- solace_agent_mesh/gateway/http_sse/app.py +19 -14
- solace_agent_mesh/gateway/http_sse/component.py +150 -118
- solace_agent_mesh/gateway/http_sse/components/components_llm.txt +1 -1
- solace_agent_mesh/gateway/http_sse/dependencies.py +21 -3
- solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +8 -8
- solace_agent_mesh/gateway/http_sse/main.py +55 -14
- solace_agent_mesh/gateway/http_sse/repository/__init__.py +19 -1
- solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +56 -98
- solace_agent_mesh/gateway/http_sse/repository/entities/project.py +81 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/project_user.py +47 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/session.py +23 -1
- solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +47 -0
- solace_agent_mesh/gateway/http_sse/repository/interfaces.py +112 -4
- solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +9 -1
- solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +51 -60
- solace_agent_mesh/gateway/http_sse/repository/models/project_model.py +51 -0
- solace_agent_mesh/gateway/http_sse/repository/models/project_user_model.py +75 -0
- solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +7 -1
- solace_agent_mesh/gateway/http_sse/repository/project_repository.py +172 -0
- solace_agent_mesh/gateway/http_sse/repository/project_user_repository.py +186 -0
- solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +125 -157
- solace_agent_mesh/gateway/http_sse/repository/session_repository.py +269 -8
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +143 -51
- solace_agent_mesh/gateway/http_sse/routers/config.py +69 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +198 -94
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/project_requests.py +48 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +68 -18
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +13 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/project_responses.py +30 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +51 -35
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +2 -0
- solace_agent_mesh/gateway/http_sse/routers/feedback.py +133 -2
- solace_agent_mesh/gateway/http_sse/routers/projects.py +542 -0
- solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +9 -11
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +154 -3
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +296 -4
- solace_agent_mesh/gateway/http_sse/services/project_service.py +403 -0
- solace_agent_mesh/gateway/http_sse/services/services_llm.txt +16 -10
- solace_agent_mesh/gateway/http_sse/services/session_service.py +178 -6
- solace_agent_mesh/gateway/http_sse/shared/exception_handlers.py +2 -3
- solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +48 -14
- solace_agent_mesh/solace_agent_mesh_llm.txt +1 -1
- {solace_agent_mesh-1.6.2.dist-info → solace_agent_mesh-1.7.0.dist-info}/METADATA +3 -5
- {solace_agent_mesh-1.6.2.dist-info → solace_agent_mesh-1.7.0.dist-info}/RECORD +219 -176
- solace_agent_mesh/assets/docs/assets/js/15ba94aa.932dd2db.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/3ac1795d.76654dd9.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/3ff0015d.2be20244.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/547e15cc.2cbb060a.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/5c2bd65f.eda4bcb2.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/631738c7.7c4594c9.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6a520c9d.ba015d81.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.f4b15f3b.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/71da7b71.ddbdfbe2.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/8024126c.56e59919.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/94e8668d.b5ddb7a1.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/da0b5bad.d08a9466.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/dd817ffc.0aa9630a.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/dd81e2b8.d590bc9e.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/de915948.27d6b065.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/e3d9abda.6b9493d0.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/e92d0134.4f395c6b.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/f284c35a.720d2ef2.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/ff4d71f2.15b02f97.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/main.d1643f0b.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.97f920d4.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1761663789856.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1761663789856.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main--3yJYl7S.css +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-DojKHS49.js +0 -342
- solace_agent_mesh/client/webui/frontend/static/assets/vendor-DSqhjwq_.js +0 -405
- /solace_agent_mesh/assets/docs/assets/js/{main.d1643f0b.js.LICENSE.txt → main.e6488e8b.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.6.2.dist-info → solace_agent_mesh-1.7.0.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.6.2.dist-info → solace_agent_mesh-1.7.0.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.6.2.dist-info → solace_agent_mesh-1.7.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -32,6 +32,7 @@ from ...common.utils.embeds import (
|
|
|
32
32
|
EMBED_REGEX,
|
|
33
33
|
EMBED_CHAIN_DELIMITER,
|
|
34
34
|
)
|
|
35
|
+
from ...common.utils.embeds.types import ResolutionMode
|
|
35
36
|
from ...agent.utils.context_helpers import get_original_session_id
|
|
36
37
|
from ...agent.adk.models.lite_llm import LiteLlm
|
|
37
38
|
from google.adk.models import LlmRequest
|
|
@@ -43,6 +44,7 @@ log = logging.getLogger(__name__)
|
|
|
43
44
|
CATEGORY_NAME = "Artifact Management"
|
|
44
45
|
CATEGORY_DESCRIPTION = "List, read, create, update, and delete artifacts."
|
|
45
46
|
|
|
47
|
+
|
|
46
48
|
async def _internal_create_artifact(
|
|
47
49
|
filename: str,
|
|
48
50
|
content: str,
|
|
@@ -371,7 +373,7 @@ async def load_artifact(
|
|
|
371
373
|
|
|
372
374
|
Args:
|
|
373
375
|
filename: The name of the artifact to load. May contain embeds.
|
|
374
|
-
version: The specific version number to load. Must be explicitly provided.
|
|
376
|
+
version: The specific version number to load. Must be explicitly provided. Versions are 0-indexed.
|
|
375
377
|
load_metadata_only (bool): If True, load only the metadata JSON. Default False.
|
|
376
378
|
max_content_length (Optional[int]): Maximum character length for text content.
|
|
377
379
|
If None, uses app configuration. Range: 100-100,000.
|
|
@@ -451,121 +453,6 @@ async def load_artifact(
|
|
|
451
453
|
}
|
|
452
454
|
|
|
453
455
|
|
|
454
|
-
async def signal_artifact_for_return(
|
|
455
|
-
filename: str,
|
|
456
|
-
version: int,
|
|
457
|
-
tool_context: ToolContext = None,
|
|
458
|
-
) -> Dict[str, Any]:
|
|
459
|
-
"""
|
|
460
|
-
Signals that a specific version of an artifact should be returned to the
|
|
461
|
-
original caller as part of the final task result.
|
|
462
|
-
|
|
463
|
-
Args:
|
|
464
|
-
filename: The name of the artifact to return. May contain embeds.
|
|
465
|
-
version: The specific version number to return. Must be explicitly provided.
|
|
466
|
-
"""
|
|
467
|
-
if not tool_context:
|
|
468
|
-
return {
|
|
469
|
-
"status": "error",
|
|
470
|
-
"filename": filename,
|
|
471
|
-
"version": version,
|
|
472
|
-
"message": "ToolContext is missing.",
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
log_identifier = (
|
|
476
|
-
f"[BuiltinArtifactTool:signal_artifact_for_return:{filename}:{version}]"
|
|
477
|
-
)
|
|
478
|
-
log.debug("%s Processing request after potential embed resolution.", log_identifier)
|
|
479
|
-
|
|
480
|
-
if version is None:
|
|
481
|
-
return {
|
|
482
|
-
"status": "error",
|
|
483
|
-
"filename": filename,
|
|
484
|
-
"version": None,
|
|
485
|
-
"message": "Version parameter is required. Use list_artifacts() to find available versions.",
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
try:
|
|
489
|
-
inv_context = tool_context._invocation_context
|
|
490
|
-
artifact_service = inv_context.artifact_service
|
|
491
|
-
host_component = getattr(inv_context.agent, "host_component", None)
|
|
492
|
-
|
|
493
|
-
if not artifact_service:
|
|
494
|
-
raise ValueError("ArtifactService is not available in the context.")
|
|
495
|
-
if not host_component:
|
|
496
|
-
raise ValueError("Host component is not available.")
|
|
497
|
-
|
|
498
|
-
app_name = inv_context.app_name
|
|
499
|
-
user_id = inv_context.user_id
|
|
500
|
-
session_id = get_original_session_id(inv_context)
|
|
501
|
-
|
|
502
|
-
versions = await artifact_service.list_versions(
|
|
503
|
-
app_name=app_name,
|
|
504
|
-
user_id=user_id,
|
|
505
|
-
session_id=session_id,
|
|
506
|
-
filename=filename,
|
|
507
|
-
)
|
|
508
|
-
if version not in versions:
|
|
509
|
-
raise FileNotFoundError(
|
|
510
|
-
f"Artifact '{filename}' version {version} not found."
|
|
511
|
-
)
|
|
512
|
-
|
|
513
|
-
a2a_context = tool_context.state.get("a2a_context", {})
|
|
514
|
-
logical_task_id = a2a_context.get("logical_task_id")
|
|
515
|
-
if not logical_task_id:
|
|
516
|
-
raise ValueError("Could not determine logical_task_id for signaling.")
|
|
517
|
-
|
|
518
|
-
with host_component.active_tasks_lock:
|
|
519
|
-
task_execution_context = host_component.active_tasks.get(logical_task_id)
|
|
520
|
-
|
|
521
|
-
if not task_execution_context:
|
|
522
|
-
raise ValueError(
|
|
523
|
-
f"TaskExecutionContext not found for task {logical_task_id}."
|
|
524
|
-
)
|
|
525
|
-
|
|
526
|
-
signal_data = {"filename": filename, "version": version}
|
|
527
|
-
task_execution_context.add_artifact_signal(signal_data)
|
|
528
|
-
|
|
529
|
-
log.info(
|
|
530
|
-
"%s Added artifact signal to TaskExecutionContext for task %s.",
|
|
531
|
-
log_identifier,
|
|
532
|
-
logical_task_id,
|
|
533
|
-
)
|
|
534
|
-
|
|
535
|
-
# Also add a placeholder to state_delta. This acts as a trigger
|
|
536
|
-
# for the host component to check the cache at the end of the turn.
|
|
537
|
-
# The key is unique to avoid collisions, but the content is just a placeholder.
|
|
538
|
-
trigger_key = f"temp:a2a_return_artifact:{uuid.uuid4().hex}"
|
|
539
|
-
tool_context.actions.state_delta[trigger_key] = {"triggered": True}
|
|
540
|
-
log.debug(
|
|
541
|
-
"%s Set state_delta trigger key '%s' to ensure signal processing.",
|
|
542
|
-
log_identifier,
|
|
543
|
-
trigger_key,
|
|
544
|
-
)
|
|
545
|
-
|
|
546
|
-
return {
|
|
547
|
-
"status": "success",
|
|
548
|
-
"message": f"Artifact '{filename}' (version {version}) has been signaled for return.",
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
except FileNotFoundError as fnf_err:
|
|
552
|
-
log.warning("%s Artifact not found: %s", log_identifier, fnf_err)
|
|
553
|
-
return {
|
|
554
|
-
"status": "error",
|
|
555
|
-
"filename": filename,
|
|
556
|
-
"version": version,
|
|
557
|
-
"message": str(fnf_err),
|
|
558
|
-
}
|
|
559
|
-
except Exception as e:
|
|
560
|
-
log.exception("%s Error signaling artifact for return: %s", log_identifier, e)
|
|
561
|
-
return {
|
|
562
|
-
"status": "error",
|
|
563
|
-
"filename": filename,
|
|
564
|
-
"version": version,
|
|
565
|
-
"message": f"Failed to signal artifact for return: {e}",
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
|
|
569
456
|
async def apply_embed_and_create_artifact(
|
|
570
457
|
output_filename: str,
|
|
571
458
|
embed_directive: str,
|
|
@@ -659,6 +546,7 @@ async def apply_embed_and_create_artifact(
|
|
|
659
546
|
format_spec=format_spec,
|
|
660
547
|
context=gateway_context,
|
|
661
548
|
log_identifier=log_identifier,
|
|
549
|
+
resolution_mode=ResolutionMode.TOOL_PARAMETER,
|
|
662
550
|
config=embed_config,
|
|
663
551
|
)
|
|
664
552
|
|
|
@@ -976,7 +864,7 @@ async def extract_content_from_artifact(
|
|
|
976
864
|
mime_type=normalized_source_mime_type,
|
|
977
865
|
content_bytes=source_artifact_content_bytes,
|
|
978
866
|
)
|
|
979
|
-
|
|
867
|
+
|
|
980
868
|
if is_text_based:
|
|
981
869
|
try:
|
|
982
870
|
artifact_text_content = source_artifact_content_bytes.decode("utf-8")
|
|
@@ -1648,17 +1536,20 @@ async def _notify_artifact_save(
|
|
|
1648
1536
|
tool_context: ToolContext = None, # Keep tool_context for signature consistency
|
|
1649
1537
|
) -> Dict[str, Any]:
|
|
1650
1538
|
"""
|
|
1651
|
-
|
|
1652
|
-
has been successfully saved. It performs no actions and simply returns its
|
|
1653
|
-
arguments to get the result into the ADK history.
|
|
1539
|
+
CRITICAL: _notify_artifact_save is automatically invoked by the system as a side-effect when you create artifacts. You should NEVER call this tool yourself. The system will call it for you and provide the results in your next turn. If you manually invoke it, you are making an error."
|
|
1654
1540
|
"""
|
|
1655
|
-
return {
|
|
1541
|
+
return {
|
|
1542
|
+
"filename": filename,
|
|
1543
|
+
"version": version,
|
|
1544
|
+
"status": status,
|
|
1545
|
+
"message": "Artifact has been created and provided to the requester",
|
|
1546
|
+
}
|
|
1656
1547
|
|
|
1657
1548
|
|
|
1658
1549
|
_notify_artifact_save_tool_def = BuiltinTool(
|
|
1659
1550
|
name="_notify_artifact_save",
|
|
1660
1551
|
implementation=_notify_artifact_save,
|
|
1661
|
-
description="
|
|
1552
|
+
description="CRITICAL: _notify_artifact_save is automatically invoked by the system as a side-effect when you create artifacts. You should NEVER call this tool yourself. The system will call it for you and provide the results in your next turn. If you manually invoke it, you are making an error.",
|
|
1662
1553
|
category="internal",
|
|
1663
1554
|
required_scopes=[], # No scopes needed for an internal notification tool
|
|
1664
1555
|
parameters=adk_types.Schema(
|
|
@@ -1762,31 +1653,6 @@ load_artifact_tool_def = BuiltinTool(
|
|
|
1762
1653
|
examples=[],
|
|
1763
1654
|
)
|
|
1764
1655
|
|
|
1765
|
-
signal_artifact_for_return_tool_def = BuiltinTool(
|
|
1766
|
-
name="signal_artifact_for_return",
|
|
1767
|
-
implementation=signal_artifact_for_return,
|
|
1768
|
-
description="Signals the host component to return a specific artifact version to the original caller of the task. This tool does not load the artifact content itself; it just flags it for return.",
|
|
1769
|
-
category="artifact_management",
|
|
1770
|
-
category_name=CATEGORY_NAME,
|
|
1771
|
-
category_description=CATEGORY_DESCRIPTION,
|
|
1772
|
-
required_scopes=["tool:artifact:signal_return"],
|
|
1773
|
-
parameters=adk_types.Schema(
|
|
1774
|
-
type=adk_types.Type.OBJECT,
|
|
1775
|
-
properties={
|
|
1776
|
-
"filename": adk_types.Schema(
|
|
1777
|
-
type=adk_types.Type.STRING,
|
|
1778
|
-
description="The name of the artifact to return. May contain embeds.",
|
|
1779
|
-
),
|
|
1780
|
-
"version": adk_types.Schema(
|
|
1781
|
-
type=adk_types.Type.INTEGER,
|
|
1782
|
-
description="The specific version number to return. Use list_artifacts() first to find available versions.",
|
|
1783
|
-
),
|
|
1784
|
-
},
|
|
1785
|
-
required=["filename", "version"],
|
|
1786
|
-
),
|
|
1787
|
-
examples=[],
|
|
1788
|
-
)
|
|
1789
|
-
|
|
1790
1656
|
apply_embed_and_create_artifact_tool_def = BuiltinTool(
|
|
1791
1657
|
name="apply_embed_and_create_artifact",
|
|
1792
1658
|
implementation=apply_embed_and_create_artifact,
|
|
@@ -1857,7 +1723,6 @@ tool_registry.register(_notify_artifact_save_tool_def)
|
|
|
1857
1723
|
tool_registry.register(append_to_artifact_tool_def)
|
|
1858
1724
|
tool_registry.register(list_artifacts_tool_def)
|
|
1859
1725
|
tool_registry.register(load_artifact_tool_def)
|
|
1860
|
-
tool_registry.register(signal_artifact_for_return_tool_def)
|
|
1861
1726
|
tool_registry.register(apply_embed_and_create_artifact_tool_def)
|
|
1862
1727
|
tool_registry.register(extract_content_from_artifact_tool_def)
|
|
1863
1728
|
|
|
@@ -34,6 +34,7 @@ from ...common.utils.embeds import (
|
|
|
34
34
|
LATE_EMBED_TYPES,
|
|
35
35
|
EMBED_DELIMITER_OPEN,
|
|
36
36
|
)
|
|
37
|
+
from ...common.utils.embeds.types import ResolutionMode
|
|
37
38
|
|
|
38
39
|
log = logging.getLogger(__name__)
|
|
39
40
|
|
|
@@ -182,6 +183,7 @@ class DynamicTool(BaseTool, ABC):
|
|
|
182
183
|
context=resolution_context,
|
|
183
184
|
resolver_func=evaluate_embed,
|
|
184
185
|
types_to_resolve=types_to_resolve,
|
|
186
|
+
resolution_mode=ResolutionMode.TOOL_PARAMETER,
|
|
185
187
|
log_identifier=log_identifier,
|
|
186
188
|
config=self.tool_config,
|
|
187
189
|
)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# DEVELOPER GUIDE
|
|
1
|
+
# DEVELOPER GUIDE for tools
|
|
2
2
|
|
|
3
3
|
## Quick Summary
|
|
4
|
-
The `tools` directory contains the complete tool system for the Solace Agent Mesh, providing built-in tools for artifact management, data analysis, audio
|
|
4
|
+
The `tools` directory contains the complete tool system for the Solace Agent Mesh, providing built-in tools for artifact management, data analysis, audio processing, image generation, web scraping, and dynamic tool creation. It includes a registry system for tool discovery and management, with support for declarative YAML-based configurations and multiple tool types including built-in, custom Python, and MCP tools.
|
|
5
5
|
|
|
6
6
|
## Files Overview
|
|
7
|
-
- `__init__.py` -
|
|
8
|
-
- `audio_tools.py` -
|
|
9
|
-
- `builtin_artifact_tools.py` - Core artifact management
|
|
10
|
-
- `builtin_data_analysis_tools.py` - Data
|
|
11
|
-
- `dynamic_tool.py` - Base classes for creating dynamic
|
|
12
|
-
- `general_agent_tools.py` - General
|
|
13
|
-
- `image_tools.py` - Image generation, editing, and multimodal
|
|
14
|
-
- `peer_agent_tool.py` - Tool for delegating tasks to
|
|
7
|
+
- `__init__.py` - Imports all tool modules to trigger registration
|
|
8
|
+
- `audio_tools.py` - Text-to-speech, transcription, and audio manipulation tools
|
|
9
|
+
- `builtin_artifact_tools.py` - Core artifact management (CRUD operations, metadata handling)
|
|
10
|
+
- `builtin_data_analysis_tools.py` - Data visualization and chart generation tools
|
|
11
|
+
- `dynamic_tool.py` - Base classes for creating custom dynamic tools
|
|
12
|
+
- `general_agent_tools.py` - General purpose tools (file conversion, diagram generation)
|
|
13
|
+
- `image_tools.py` - Image generation, editing, and multimodal analysis tools
|
|
14
|
+
- `peer_agent_tool.py` - Tool for delegating tasks to other agents
|
|
15
15
|
- `registry.py` - Singleton registry for tool discovery and management
|
|
16
|
-
- `test_tools.py` - Testing utilities for timeouts and error handling
|
|
16
|
+
- `test_tools.py` - Testing and debugging utilities for timeouts and error handling
|
|
17
17
|
- `tool_config_types.py` - Pydantic models for YAML-based tool configurations
|
|
18
18
|
- `tool_definition.py` - Base tool definition classes and structures
|
|
19
19
|
- `web_tools.py` - Web scraping and content extraction tools
|
|
@@ -21,60 +21,61 @@ The `tools` directory contains the complete tool system for the Solace Agent Mes
|
|
|
21
21
|
## Developer API Reference
|
|
22
22
|
|
|
23
23
|
### __init__.py
|
|
24
|
-
**Purpose:**
|
|
24
|
+
**Purpose:** Ensures all tool modules are imported to trigger registration
|
|
25
25
|
**Import:** `from solace_agent_mesh.agent.tools import *`
|
|
26
26
|
|
|
27
|
-
No public classes or functions - this is an initialization module.
|
|
28
|
-
|
|
29
27
|
### audio_tools.py
|
|
30
|
-
**Purpose:**
|
|
28
|
+
**Purpose:** Audio processing, text-to-speech, and transcription capabilities
|
|
31
29
|
**Import:** `from solace_agent_mesh.agent.tools.audio_tools import select_voice, text_to_speech, multi_speaker_text_to_speech, concatenate_audio, transcribe_audio`
|
|
32
30
|
|
|
33
31
|
**Functions:**
|
|
34
|
-
- `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 based on
|
|
35
|
-
- `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
|
|
36
|
-
- `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]` -
|
|
37
|
-
- `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
|
|
38
|
-
- `transcribe_audio(audio_filename: str, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Transcribes audio
|
|
32
|
+
- `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 based on criteria
|
|
33
|
+
- `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
|
|
34
|
+
- `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
|
|
35
|
+
- `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
|
|
36
|
+
- `transcribe_audio(audio_filename: str, output_filename: Optional[str] = None, description: Optional[str] = None, tool_context: ToolContext = None, tool_config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]` - Transcribes audio to text
|
|
39
37
|
|
|
40
38
|
**Constants/Variables:**
|
|
41
|
-
- `
|
|
42
|
-
- `
|
|
43
|
-
- `
|
|
44
|
-
- `
|
|
39
|
+
- `ALL_AVAILABLE_VOICES: List[str]` - List of all available TTS voices
|
|
40
|
+
- `SUPPORTED_LANGUAGES: Dict[str, str]` - Mapping of language names to BCP-47 codes
|
|
41
|
+
- `VOICE_TONE_MAPPING: Dict[str, List[str]]` - Maps tones to voice names
|
|
42
|
+
- `GENDER_TO_VOICE_MAPPING: Dict[str, List[str]]` - Maps genders to voice names
|
|
45
43
|
|
|
46
44
|
**Usage Examples:**
|
|
47
45
|
```python
|
|
48
|
-
#
|
|
46
|
+
# Select a voice
|
|
47
|
+
result = await select_voice(gender="female", tone="friendly")
|
|
48
|
+
voice_name = result["voice_name"]
|
|
49
|
+
|
|
50
|
+
# Generate speech
|
|
49
51
|
result = await text_to_speech(
|
|
50
|
-
text="Hello
|
|
51
|
-
voice_name=
|
|
52
|
+
text="Hello world",
|
|
53
|
+
voice_name=voice_name,
|
|
52
54
|
tool_context=context
|
|
53
55
|
)
|
|
54
56
|
|
|
55
57
|
# Multi-speaker conversation
|
|
56
|
-
conversation = "Speaker1: Hello
|
|
58
|
+
conversation = "Speaker1: Hello\nSpeaker2: Hi there"
|
|
57
59
|
result = await multi_speaker_text_to_speech(
|
|
58
60
|
conversation_text=conversation,
|
|
59
61
|
speaker_configs=[
|
|
60
62
|
{"name": "Speaker1", "gender": "female", "tone": "friendly"},
|
|
61
|
-
{"name": "Speaker2", "gender": "male", "tone": "
|
|
63
|
+
{"name": "Speaker2", "gender": "male", "tone": "professional"}
|
|
62
64
|
],
|
|
63
65
|
tool_context=context
|
|
64
66
|
)
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
### builtin_artifact_tools.py
|
|
68
|
-
**Purpose:** Core artifact management
|
|
69
|
-
**Import:** `from solace_agent_mesh.agent.tools.builtin_artifact_tools import list_artifacts, load_artifact,
|
|
70
|
+
**Purpose:** Core artifact management operations (CRUD, metadata, embeds)
|
|
71
|
+
**Import:** `from solace_agent_mesh.agent.tools.builtin_artifact_tools import list_artifacts, load_artifact, append_to_artifact, apply_embed_and_create_artifact, extract_content_from_artifact, delete_artifact`
|
|
70
72
|
|
|
71
73
|
**Functions:**
|
|
72
|
-
- `list_artifacts(tool_context: ToolContext = None) -> Dict[str, Any]` - Lists all
|
|
74
|
+
- `list_artifacts(tool_context: ToolContext = None) -> Dict[str, Any]` - Lists all artifacts with metadata summaries
|
|
73
75
|
- `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
|
|
74
|
-
- `
|
|
75
|
-
- `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 embed directives and creates
|
|
76
|
+
- `append_to_artifact(filename: str, content_chunk: str, mime_type: str, tool_context: ToolContext = None) -> Dict[str, Any]` - Appends content to existing artifact
|
|
77
|
+
- `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 embed directives and creates artifacts
|
|
76
78
|
- `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
|
|
77
|
-
- `append_to_artifact(filename: str, content_chunk: str, mime_type: str, tool_context: ToolContext = None) -> Dict[str, Any]` - Appends content to existing artifacts
|
|
78
79
|
- `delete_artifact(filename: str, version: Optional[int] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Deletes artifact versions
|
|
79
80
|
|
|
80
81
|
**Usage Examples:**
|
|
@@ -82,9 +83,9 @@ result = await multi_speaker_text_to_speech(
|
|
|
82
83
|
# List all artifacts
|
|
83
84
|
artifacts = await list_artifacts(tool_context=context)
|
|
84
85
|
|
|
85
|
-
# Load specific artifact
|
|
86
|
+
# Load specific artifact
|
|
86
87
|
content = await load_artifact(
|
|
87
|
-
filename="data.
|
|
88
|
+
filename="data.json",
|
|
88
89
|
version=1,
|
|
89
90
|
tool_context=context
|
|
90
91
|
)
|
|
@@ -98,16 +99,16 @@ result = await extract_content_from_artifact(
|
|
|
98
99
|
```
|
|
99
100
|
|
|
100
101
|
### builtin_data_analysis_tools.py
|
|
101
|
-
**Purpose:** Data
|
|
102
|
+
**Purpose:** Data visualization and chart generation
|
|
102
103
|
**Import:** `from solace_agent_mesh.agent.tools.builtin_data_analysis_tools import create_chart_from_plotly_config`
|
|
103
104
|
|
|
104
105
|
**Functions:**
|
|
105
|
-
- `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]` -
|
|
106
|
+
- `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]` - Creates charts from Plotly configurations
|
|
106
107
|
|
|
107
108
|
**Usage Examples:**
|
|
108
109
|
```python
|
|
109
110
|
# Create chart from JSON config
|
|
110
|
-
plotly_config = '{"data": [{"x": [1,2,3], "y": [4,5,6], "type": "scatter"}]}'
|
|
111
|
+
plotly_config = '{"data": [{"x": [1,2,3], "y": [4,5,6], "type": "scatter"}], "layout": {"title": "Sample Chart"}}'
|
|
111
112
|
result = await create_chart_from_plotly_config(
|
|
112
113
|
config_content=plotly_config,
|
|
113
114
|
config_format="json",
|
|
@@ -117,23 +118,21 @@ result = await create_chart_from_plotly_config(
|
|
|
117
118
|
```
|
|
118
119
|
|
|
119
120
|
### dynamic_tool.py
|
|
120
|
-
**Purpose:** Base classes for creating dynamic
|
|
121
|
+
**Purpose:** Base classes for creating custom dynamic tools
|
|
121
122
|
**Import:** `from solace_agent_mesh.agent.tools.dynamic_tool import DynamicTool, DynamicToolProvider`
|
|
122
123
|
|
|
123
124
|
**Classes:**
|
|
124
|
-
- `DynamicTool(tool_config: Optional[Union[dict, BaseModel]] = None)` - Base class for
|
|
125
|
-
- `tool_name: str` - Property returning the function name
|
|
125
|
+
- `DynamicTool(tool_config: Optional[Union[dict, BaseModel]] = None)` - Base class for programmatic tools
|
|
126
|
+
- `tool_name: str` - Property returning the function name
|
|
126
127
|
- `tool_description: str` - Property returning tool description
|
|
127
128
|
- `parameters_schema: adk_types.Schema` - Property returning parameter schema
|
|
128
|
-
- `raw_string_args: List[str]` - Property listing args
|
|
129
|
-
- `resolution_type: Literal["early", "all"]` - Property
|
|
130
|
-
- `
|
|
131
|
-
- `_run_async_impl(args: dict, tool_context: ToolContext, credential: Optional[str] = None) -> dict` - Abstract method for tool implementation
|
|
129
|
+
- `raw_string_args: List[str]` - Property listing args to skip embed resolution
|
|
130
|
+
- `resolution_type: Literal["early", "all"]` - Property controlling embed resolution
|
|
131
|
+
- `_run_async_impl(args: dict, tool_context: ToolContext, credential: Optional[str] = None) -> dict` - Abstract method to implement tool logic
|
|
132
132
|
|
|
133
|
-
- `DynamicToolProvider()` - Base class for tool providers
|
|
134
|
-
- `register_tool(func: Callable) -> Callable` - Class method decorator for registering
|
|
135
|
-
- `create_tools(tool_config: Optional[Union[dict, BaseModel]] = None) -> List[DynamicTool]` - Abstract method
|
|
136
|
-
- `get_all_tools_for_framework(tool_config: Optional[Union[dict, BaseModel]] = None) -> List[DynamicTool]` - Framework method combining decorated and custom tools
|
|
133
|
+
- `DynamicToolProvider()` - Base class for tool providers
|
|
134
|
+
- `register_tool(func: Callable) -> Callable` - Class method decorator for registering tools
|
|
135
|
+
- `create_tools(tool_config: Optional[Union[dict, BaseModel]] = None) -> List[DynamicTool]` - Abstract method to create custom tools
|
|
137
136
|
|
|
138
137
|
**Usage Examples:**
|
|
139
138
|
```python
|
|
@@ -160,24 +159,24 @@ class MyCustomTool(DynamicTool):
|
|
|
160
159
|
async def _run_async_impl(self, args: dict, tool_context: ToolContext, credential: Optional[str] = None) -> dict:
|
|
161
160
|
return {"result": f"Processed: {args['input']}"}
|
|
162
161
|
|
|
163
|
-
# Create a tool provider
|
|
162
|
+
# Create a tool provider
|
|
164
163
|
class MyToolProvider(DynamicToolProvider):
|
|
165
164
|
@DynamicToolProvider.register_tool
|
|
166
|
-
async def my_decorated_tool(self,
|
|
167
|
-
"""
|
|
168
|
-
return {"
|
|
165
|
+
async def my_decorated_tool(self, message: str, tool_context: ToolContext = None) -> dict:
|
|
166
|
+
"""A tool created via decorator."""
|
|
167
|
+
return {"response": f"Hello {message}"}
|
|
169
168
|
|
|
170
169
|
def create_tools(self, tool_config: Optional[Union[dict, BaseModel]] = None) -> List[DynamicTool]:
|
|
171
170
|
return [MyCustomTool(tool_config)]
|
|
172
171
|
```
|
|
173
172
|
|
|
174
173
|
### general_agent_tools.py
|
|
175
|
-
**Purpose:** General
|
|
174
|
+
**Purpose:** General purpose utility tools
|
|
176
175
|
**Import:** `from solace_agent_mesh.agent.tools.general_agent_tools import convert_file_to_markdown, mermaid_diagram_generator`
|
|
177
176
|
|
|
178
177
|
**Functions:**
|
|
179
|
-
- `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
|
|
180
|
-
- `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
|
|
178
|
+
- `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
|
|
179
|
+
- `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
|
|
181
180
|
|
|
182
181
|
**Usage Examples:**
|
|
183
182
|
```python
|
|
@@ -201,32 +200,32 @@ result = await mermaid_diagram_generator(
|
|
|
201
200
|
```
|
|
202
201
|
|
|
203
202
|
### image_tools.py
|
|
204
|
-
**Purpose:** Image generation, editing, and multimodal
|
|
203
|
+
**Purpose:** Image generation, editing, and multimodal analysis
|
|
205
204
|
**Import:** `from solace_agent_mesh.agent.tools.image_tools import create_image_from_description, describe_image, describe_audio, edit_image_with_gemini`
|
|
206
205
|
|
|
207
206
|
**Functions:**
|
|
208
207
|
- `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
|
|
209
|
-
- `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
|
|
210
|
-
- `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
|
|
211
|
-
- `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
|
|
208
|
+
- `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 API
|
|
209
|
+
- `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 API
|
|
210
|
+
- `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
|
|
212
211
|
|
|
213
212
|
**Usage Examples:**
|
|
214
213
|
```python
|
|
215
|
-
# Generate image
|
|
214
|
+
# Generate image
|
|
216
215
|
result = await create_image_from_description(
|
|
217
|
-
image_description="A sunset over mountains
|
|
216
|
+
image_description="A sunset over mountains",
|
|
218
217
|
output_filename="sunset.png",
|
|
219
218
|
tool_context=context
|
|
220
219
|
)
|
|
221
220
|
|
|
222
|
-
# Describe
|
|
221
|
+
# Describe image
|
|
223
222
|
result = await describe_image(
|
|
224
223
|
image_filename="photo.jpg",
|
|
225
|
-
prompt="What objects are
|
|
224
|
+
prompt="What objects are in this image?",
|
|
226
225
|
tool_context=context
|
|
227
226
|
)
|
|
228
227
|
|
|
229
|
-
# Edit
|
|
228
|
+
# Edit image
|
|
230
229
|
result = await edit_image_with_gemini(
|
|
231
230
|
image_filename="original.jpg",
|
|
232
231
|
edit_prompt="Add a rainbow in the sky",
|
|
@@ -235,29 +234,43 @@ result = await edit_image_with_gemini(
|
|
|
235
234
|
```
|
|
236
235
|
|
|
237
236
|
### peer_agent_tool.py
|
|
238
|
-
**Purpose:**
|
|
237
|
+
**Purpose:** Tool for delegating tasks to other agents in the mesh
|
|
239
238
|
**Import:** `from solace_agent_mesh.agent.tools.peer_agent_tool import PeerAgentTool`
|
|
240
239
|
|
|
241
240
|
**Classes:**
|
|
242
|
-
- `PeerAgentTool(target_agent_name: str, host_component)` - Tool for
|
|
243
|
-
- `target_agent_name: str` - Name of the
|
|
244
|
-
- `host_component` - Reference to the
|
|
245
|
-
- `is_long_running: bool` - Always True for async delegation
|
|
241
|
+
- `PeerAgentTool(target_agent_name: str, host_component)` - Tool for peer agent communication
|
|
242
|
+
- `target_agent_name: str` - Name of the target agent
|
|
243
|
+
- `host_component` - Reference to the host component
|
|
246
244
|
- `run_async(*, args: Dict[str, Any], tool_context: ToolContext) -> Any` - Delegates task to peer agent
|
|
247
245
|
|
|
248
246
|
**Usage Examples:**
|
|
249
247
|
```python
|
|
250
|
-
# Create peer
|
|
248
|
+
# Create peer tool (typically done automatically)
|
|
251
249
|
peer_tool = PeerAgentTool("data_analyst_agent", host_component)
|
|
252
250
|
|
|
253
|
-
#
|
|
254
|
-
# {
|
|
255
|
-
# "task_description": "Analyze the sales data and create a summary report",
|
|
256
|
-
# "user_query": "What were our top performing products last quarter?",
|
|
257
|
-
# "artifacts": [{"filename": "sales_data.csv", "version": "latest"}]
|
|
258
|
-
# }
|
|
251
|
+
# Use via ADK (the tool is registered automatically)
|
|
252
|
+
# The LLM would call: peer_data_analyst_agent(task_description="Analyze sales data", artifacts=[{"filename": "sales.csv"}])
|
|
259
253
|
```
|
|
260
254
|
|
|
261
255
|
### registry.py
|
|
256
|
+
**Purpose:** Singleton registry for tool discovery and management
|
|
257
|
+
**Import:** `from solace_agent_mesh.agent.tools.registry import tool_registry`
|
|
258
|
+
|
|
259
|
+
**Classes:**
|
|
260
|
+
- `_ToolRegistry()` - Singleton registry for tools
|
|
261
|
+
- `register(tool: BuiltinTool)` - Registers a tool
|
|
262
|
+
- `get_tool_by_name(name: str) -> Optional[BuiltinTool]` - Gets tool by name
|
|
263
|
+
- `get_tools_by_category(category_name: str) -> List[BuiltinTool]` - Gets tools by category
|
|
264
|
+
- `get_all_tools() -> List[BuiltinTool]` - Gets all registered tools
|
|
265
|
+
- `clear()` - Clears registry (testing only)
|
|
266
|
+
|
|
267
|
+
**Constants/Variables:**
|
|
268
|
+
- `tool_registry: _ToolRegistry` - Global singleton instance
|
|
269
|
+
|
|
270
|
+
**Usage Examples:**
|
|
271
|
+
```python
|
|
272
|
+
from solace_agent_mesh.agent.tools.registry import tool_registry
|
|
273
|
+
|
|
274
|
+
# Register a tool
|
|
262
275
|
|
|
263
|
-
# content_hash:
|
|
276
|
+
# content_hash: b3f2b9ed392ce5771853db0564d776f20e30b7e0706d9126611eca5697e6a05e
|
|
@@ -76,17 +76,18 @@ result = await multi_speaker_text_to_speech(
|
|
|
76
76
|
|
|
77
77
|
### builtin_artifact_tools.py
|
|
78
78
|
**Purpose:** Core artifact management and content processing tools
|
|
79
|
-
**Import:** `from solace_agent_mesh.agent.tools.builtin_artifact_tools import list_artifacts, load_artifact,
|
|
79
|
+
**Import:** `from solace_agent_mesh.agent.tools.builtin_artifact_tools import list_artifacts, load_artifact, apply_embed_and_create_artifact, extract_content_from_artifact, append_to_artifact, delete_artifact`
|
|
80
80
|
|
|
81
81
|
**Functions:**
|
|
82
82
|
- `list_artifacts(tool_context: ToolContext = None) -> Dict[str, Any]` - Lists all available artifacts with metadata summaries
|
|
83
83
|
- `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
|
|
84
|
-
- `signal_artifact_for_return(filename: str, version: int, tool_context: ToolContext = None) -> Dict[str, Any]` - Signals artifact to be returned to caller
|
|
85
84
|
- `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 embed directives and creates new artifacts
|
|
86
85
|
- `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
|
|
87
86
|
- `append_to_artifact(filename: str, content_chunk: str, mime_type: str, tool_context: ToolContext = None) -> Dict[str, Any]` - Appends content to existing artifacts
|
|
88
87
|
- `delete_artifact(filename: str, version: Optional[int] = None, tool_context: ToolContext = None) -> Dict[str, Any]` - Deletes artifact versions
|
|
89
88
|
|
|
89
|
+
**Note:** To return artifacts to users, use the `«artifact_return:filename[:version]»` embed in your response text instead of a tool call. This is more efficient and provides a better user experience.
|
|
90
|
+
|
|
90
91
|
**Usage Examples:**
|
|
91
92
|
```python
|
|
92
93
|
# List all artifacts
|
|
@@ -882,6 +882,9 @@ async def get_artifact_info_list(
|
|
|
882
882
|
else None
|
|
883
883
|
)
|
|
884
884
|
|
|
885
|
+
# Extract source from metadata
|
|
886
|
+
source = metadata.get("source")
|
|
887
|
+
|
|
885
888
|
artifact_info_list.append(
|
|
886
889
|
ArtifactInfo(
|
|
887
890
|
filename=filename,
|
|
@@ -892,6 +895,7 @@ async def get_artifact_info_list(
|
|
|
892
895
|
description=description,
|
|
893
896
|
version=loaded_version_num,
|
|
894
897
|
version_count=version_count,
|
|
898
|
+
source=source,
|
|
895
899
|
)
|
|
896
900
|
)
|
|
897
901
|
log.debug(
|
|
@@ -25,6 +25,7 @@ The `utils` directory provides a collection of helper modules designed to suppor
|
|
|
25
25
|
- `format_metadata_for_llm(metadata: Dict[str, Any]) -> str` - Formats metadata into LLM-friendly text
|
|
26
26
|
- `decode_and_get_bytes(content_str: str, mime_type: str, log_identifier: str) -> Tuple[bytes, str]` - Decodes content based on MIME type (base64 for binary, UTF-8 for text)
|
|
27
27
|
- `generate_artifact_metadata_summary(component: "SamAgentComponent", artifact_identifiers: List[Dict[str, Any]], user_id: str, session_id: str, app_name: str, header_text: Optional[str] = None) -> str` - Generates YAML summary of multiple artifacts' metadata
|
|
28
|
+
- `process_artifact_upload(artifact_service: BaseArtifactService, component: Any, user_id: str, session_id: str, filename: str, content_bytes: bytes, mime_type: str, metadata_json: Optional[str] = None, log_prefix: str = "[ArtifactUpload]") -> Dict[str, Any]` - Common logic for processing artifact uploads with validation and storage
|
|
28
29
|
|
|
29
30
|
**Constants/Variables:**
|
|
30
31
|
- `METADATA_SUFFIX: str` - Suffix for metadata files (".metadata.json")
|
|
@@ -40,7 +41,8 @@ from solace_agent_mesh.agent.utils.artifact_helpers import (
|
|
|
40
41
|
get_artifact_info_list,
|
|
41
42
|
ensure_correct_extension,
|
|
42
43
|
format_artifact_uri,
|
|
43
|
-
parse_artifact_uri
|
|
44
|
+
parse_artifact_uri,
|
|
45
|
+
process_artifact_upload
|
|
44
46
|
)
|
|
45
47
|
|
|
46
48
|
async def artifact_example():
|
|
@@ -61,6 +63,18 @@ async def artifact_example():
|
|
|
61
63
|
timestamp=datetime.now(timezone.utc)
|
|
62
64
|
)
|
|
63
65
|
|
|
66
|
+
# Process artifact upload (higher-level function)
|
|
67
|
+
upload_result = await process_artifact_upload(
|
|
68
|
+
artifact_service=service,
|
|
69
|
+
component=component,
|
|
70
|
+
user_id="user123",
|
|
71
|
+
session_id="session456",
|
|
72
|
+
filename="data.csv",
|
|
73
|
+
content_bytes=csv_data,
|
|
74
|
+
mime_type="text/csv",
|
|
75
|
+
metadata_json='{"description": "Uploaded data"}'
|
|
76
|
+
)
|
|
77
|
+
|
|
64
78
|
# Load artifact content
|
|
65
79
|
loaded = await load_artifact_content_or_metadata(
|
|
66
80
|
artifact_service=service,
|
|
@@ -135,4 +149,4 @@ def my_tool(callback_context):
|
|
|
135
149
|
# "session123:tool456" -> "session123"
|
|
136
150
|
```
|
|
137
151
|
|
|
138
|
-
# content_hash:
|
|
152
|
+
# content_hash: b9691e1ea5f36ef138caa844b72f38b76652ea8cf79d1814e7a5f7362b922ffa
|