solace-agent-mesh 0.2.4__py3-none-any.whl → 1.0.2__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/__init__.py +5 -0
- solace_agent_mesh/agent/adk/adk_llm.txt +93 -0
- solace_agent_mesh/agent/adk/app_llm_agent.py +26 -0
- solace_agent_mesh/agent/adk/callbacks.py +1716 -0
- solace_agent_mesh/agent/adk/filesystem_artifact_service.py +381 -0
- solace_agent_mesh/agent/adk/invocation_monitor.py +295 -0
- solace_agent_mesh/agent/adk/models/lite_llm.py +872 -0
- solace_agent_mesh/agent/adk/models/models_llm.txt +94 -0
- solace_agent_mesh/agent/adk/runner.py +357 -0
- solace_agent_mesh/agent/adk/services.py +240 -0
- solace_agent_mesh/agent/adk/setup.py +751 -0
- solace_agent_mesh/agent/adk/stream_parser.py +214 -0
- solace_agent_mesh/agent/adk/tool_wrapper.py +139 -0
- solace_agent_mesh/agent/agent_llm.txt +41 -0
- solace_agent_mesh/agent/protocol/event_handlers.py +1444 -0
- solace_agent_mesh/agent/protocol/protocol_llm.txt +21 -0
- solace_agent_mesh/agent/sac/app.py +640 -0
- solace_agent_mesh/agent/sac/component.py +3496 -0
- solace_agent_mesh/agent/sac/patch_adk.py +111 -0
- solace_agent_mesh/agent/sac/sac_llm.txt +105 -0
- solace_agent_mesh/agent/sac/task_execution_context.py +185 -0
- solace_agent_mesh/agent/testing/__init__.py +3 -0
- solace_agent_mesh/agent/testing/debug_utils.py +135 -0
- solace_agent_mesh/agent/testing/testing_llm.txt +90 -0
- solace_agent_mesh/agent/tools/__init__.py +14 -0
- solace_agent_mesh/agent/tools/audio_tools.py +1622 -0
- solace_agent_mesh/agent/tools/builtin_artifact_tools.py +1954 -0
- solace_agent_mesh/agent/tools/builtin_data_analysis_tools.py +238 -0
- solace_agent_mesh/agent/tools/general_agent_tools.py +571 -0
- solace_agent_mesh/agent/tools/image_tools.py +1184 -0
- solace_agent_mesh/agent/tools/peer_agent_tool.py +290 -0
- solace_agent_mesh/agent/tools/registry.py +36 -0
- solace_agent_mesh/agent/tools/test_tools.py +135 -0
- solace_agent_mesh/agent/tools/tool_definition.py +45 -0
- solace_agent_mesh/agent/tools/tools_llm.txt +104 -0
- solace_agent_mesh/agent/tools/web_tools.py +381 -0
- solace_agent_mesh/agent/utils/artifact_helpers.py +927 -0
- solace_agent_mesh/agent/utils/config_parser.py +47 -0
- solace_agent_mesh/agent/utils/context_helpers.py +60 -0
- solace_agent_mesh/agent/utils/utils_llm.txt +153 -0
- solace_agent_mesh/assets/docs/404.html +16 -0
- solace_agent_mesh/assets/docs/assets/css/styles.906a1503.css +1 -0
- solace_agent_mesh/assets/docs/assets/images/Solace_AI_Framework_With_Broker-85f0a306a9bcdd20b390b7a949f6d862.png +0 -0
- solace_agent_mesh/assets/docs/assets/images/sac-flows-80d5b603c6aafd33e87945680ce0abf3.png +0 -0
- solace_agent_mesh/assets/docs/assets/images/sac_parts_of_a_component-cb3d0424b1d0c17734c5435cca6b4082.png +0 -0
- solace_agent_mesh/assets/docs/assets/js/04989206.674a8007.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/0e682baa.79f0ab22.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/1001.0182a8bd.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/1023fc19.015679ca.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/1039.0bd46aa1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/149.b797a808.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/1523c6b4.91c7bc01.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/165.6a39807d.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/165.6a39807d.js.LICENSE.txt +9 -0
- solace_agent_mesh/assets/docs/assets/js/166ab619.7d97ccaf.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/17896441.a5e82f9b.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/17896441.a5e82f9b.js.LICENSE.txt +7 -0
- solace_agent_mesh/assets/docs/assets/js/1c6e87d2.a8c5ce5a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2130.ab9fd314.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/21ceee5f.614fa8dd.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2237.5e477fc6.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2334.622a6395.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2a9cab12.8909df92.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3219.adc1d663.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/332e10b5.7a103f42.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3624.b524e433.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/375.708d48db.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3834.b6cd790e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3d406171.f722eaf5.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4250.95455b28.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/42b3f8d8.36090198.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4356.d169ab5b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/442a8107.5ba94b65.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4458.518e66fa.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4488.c7cc3442.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4494.6ee23046.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4855.fc4444b6.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4866.22daefc0.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4950.ca4caeda.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4c2787c2.66ee00e9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5388.7a136447.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/55f47984.c484bf96.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5607.081356f8.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5864.b0d0e9de.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5b4258a4.bda20761.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5e95c892.558d5167.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6143.0a1464c9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6395.e9c73649.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6796.51d2c9b7.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6976.379be23b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6978.ee0b945c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/7040.cb436723.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/7195.412f418a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/7280.3fb73bdb.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/768e31b0.a12673db.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/7845.e33e7c4c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/7900.69516146.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8356.8a379c04.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/85387663.6bf41934.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8567.4732c6b7.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8573.cb04eda5.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8577.1d54e766.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8591.d7c16be6.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/8591.d7c16be6.js.LICENSE.txt +61 -0
- solace_agent_mesh/assets/docs/assets/js/8709.7ecd4047.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8731.49e930c2.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8908.f9d1b506.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9157.b4093d07.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9278.a4fd875d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/945fb41e.74d728aa.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9616.b75c2f6d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9793.c6d16376.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9eff14a2.1bf8f61c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a3a92b25.26ca071f.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a7bd4aaa.2204d2f7.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a94703ab.0438dbc2.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/aba21aa0.c42a534c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/aba87c2f.d3e2dcc3.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ae4415af.8e279b5d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/b7006a3a.40b10c9d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/bac0be12.f50d9bac.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/bb2ef573.207e6990.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/c2c06897.63b76e9e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cc969b05.954186d4.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cd3d4052.ca6eed8c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ced92a13.fb92e7ca.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cee5d587.f5b73ca1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.ecc3d195.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f897a61a.f8c53b0f.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/fbfa3e75.aca209c9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/main.c6286d7c.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/main.c6286d7c.js.LICENSE.txt +81 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.d5133813.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +128 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +91 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +201 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +91 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +55 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +82 -0
- solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +77 -0
- solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +48 -0
- solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +54 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +17 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +45 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +76 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +150 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +54 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +267 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +136 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +116 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +80 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +164 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +57 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +72 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +102 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +99 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +90 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +107 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +152 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +103 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +170 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +200 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +54 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +69 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +59 -0
- solace_agent_mesh/assets/docs/img/Solace_AI_Framework_README.png +0 -0
- solace_agent_mesh/assets/docs/img/Solace_AI_Framework_With_Broker.png +0 -0
- solace_agent_mesh/assets/docs/img/logo.png +0 -0
- solace_agent_mesh/assets/docs/img/sac-flows.png +0 -0
- solace_agent_mesh/assets/docs/img/sac_parts_of_a_component.png +0 -0
- solace_agent_mesh/assets/docs/img/solace-logo.png +0 -0
- solace_agent_mesh/assets/docs/lunr-index-1754075282978.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -0
- solace_agent_mesh/assets/docs/search-doc-1754075282978.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -0
- solace_agent_mesh/assets/docs/sitemap.xml +1 -0
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/__init__.py +15 -0
- solace_agent_mesh/cli/commands/add_cmd/add_cmd_llm.txt +250 -0
- solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +659 -0
- solace_agent_mesh/cli/commands/add_cmd/gateway_cmd.py +322 -0
- solace_agent_mesh/cli/commands/add_cmd/web_add_agent_step.py +93 -0
- solace_agent_mesh/cli/commands/add_cmd/web_add_gateway_step.py +118 -0
- solace_agent_mesh/cli/commands/docs_cmd.py +57 -0
- solace_agent_mesh/cli/commands/eval_cmd.py +64 -0
- solace_agent_mesh/cli/commands/init_cmd/__init__.py +404 -0
- solace_agent_mesh/cli/commands/init_cmd/broker_step.py +201 -0
- solace_agent_mesh/cli/commands/init_cmd/directory_step.py +28 -0
- solace_agent_mesh/cli/commands/init_cmd/env_step.py +205 -0
- solace_agent_mesh/cli/commands/init_cmd/init_cmd_llm.txt +365 -0
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +407 -0
- solace_agent_mesh/cli/commands/init_cmd/project_files_step.py +38 -0
- solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +110 -0
- solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +183 -0
- solace_agent_mesh/cli/commands/plugin_cmd/__init__.py +18 -0
- solace_agent_mesh/cli/commands/plugin_cmd/add_cmd.py +372 -0
- solace_agent_mesh/cli/commands/plugin_cmd/build_cmd.py +86 -0
- solace_agent_mesh/cli/commands/plugin_cmd/catalog_cmd.py +139 -0
- solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +309 -0
- solace_agent_mesh/cli/commands/plugin_cmd/official_registry.py +175 -0
- solace_agent_mesh/cli/commands/plugin_cmd/plugin_cmd_llm.txt +305 -0
- solace_agent_mesh/cli/commands/run_cmd.py +158 -0
- solace_agent_mesh/cli/main.py +17 -294
- solace_agent_mesh/cli/utils.py +135 -204
- solace_agent_mesh/client/webui/frontend/static/assets/authCallback-DvlO62me.js +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/client-bp6u3qVZ.js +49 -0
- solace_agent_mesh/client/webui/frontend/static/assets/favicon-BLgzUch9.ico +0 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-D11Lmy9p.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-Gfk3BYn5.js +663 -0
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +14 -0
- solace_agent_mesh/client/webui/frontend/static/index.html +15 -0
- solace_agent_mesh/common/__init__.py +1 -0
- solace_agent_mesh/common/a2a_protocol.py +564 -0
- solace_agent_mesh/common/agent_registry.py +42 -0
- solace_agent_mesh/common/client/__init__.py +4 -0
- solace_agent_mesh/common/client/card_resolver.py +21 -0
- solace_agent_mesh/common/client/client.py +85 -0
- solace_agent_mesh/common/client/client_llm.txt +133 -0
- solace_agent_mesh/common/common_llm.txt +144 -0
- solace_agent_mesh/common/constants.py +1 -14
- solace_agent_mesh/common/middleware/__init__.py +12 -0
- solace_agent_mesh/common/middleware/config_resolver.py +130 -0
- solace_agent_mesh/common/middleware/middleware_llm.txt +174 -0
- solace_agent_mesh/common/middleware/registry.py +125 -0
- solace_agent_mesh/common/server/__init__.py +4 -0
- solace_agent_mesh/common/server/server.py +122 -0
- solace_agent_mesh/common/server/server_llm.txt +169 -0
- solace_agent_mesh/common/server/task_manager.py +291 -0
- solace_agent_mesh/common/server/utils.py +28 -0
- solace_agent_mesh/common/services/__init__.py +4 -0
- solace_agent_mesh/common/services/employee_service.py +162 -0
- solace_agent_mesh/common/services/identity_service.py +129 -0
- solace_agent_mesh/common/services/providers/__init__.py +4 -0
- solace_agent_mesh/common/services/providers/local_file_identity_service.py +148 -0
- solace_agent_mesh/common/services/providers/providers_llm.txt +113 -0
- solace_agent_mesh/common/services/services_llm.txt +132 -0
- solace_agent_mesh/common/types.py +411 -0
- solace_agent_mesh/common/utils/__init__.py +7 -0
- solace_agent_mesh/common/utils/asyncio_macos_fix.py +86 -0
- solace_agent_mesh/common/utils/embeds/__init__.py +33 -0
- solace_agent_mesh/common/utils/embeds/constants.py +55 -0
- solace_agent_mesh/common/utils/embeds/converter.py +452 -0
- solace_agent_mesh/common/utils/embeds/embeds_llm.txt +124 -0
- solace_agent_mesh/common/utils/embeds/evaluators.py +394 -0
- solace_agent_mesh/common/utils/embeds/modifiers.py +816 -0
- solace_agent_mesh/common/utils/embeds/resolver.py +865 -0
- solace_agent_mesh/common/utils/embeds/types.py +14 -0
- solace_agent_mesh/common/utils/in_memory_cache.py +108 -0
- solace_agent_mesh/common/utils/initializer.py +51 -0
- solace_agent_mesh/common/utils/log_formatters.py +44 -0
- solace_agent_mesh/common/utils/mime_helpers.py +106 -0
- solace_agent_mesh/common/utils/push_notification_auth.py +134 -0
- solace_agent_mesh/common/utils/utils_llm.txt +67 -0
- solace_agent_mesh/config_portal/backend/common.py +66 -24
- solace_agent_mesh/config_portal/backend/plugin_catalog/constants.py +24 -0
- solace_agent_mesh/config_portal/backend/plugin_catalog/models.py +49 -0
- solace_agent_mesh/config_portal/backend/plugin_catalog/registry_manager.py +164 -0
- solace_agent_mesh/config_portal/backend/plugin_catalog/scraper.py +521 -0
- solace_agent_mesh/config_portal/backend/plugin_catalog_server.py +217 -0
- solace_agent_mesh/config_portal/backend/server.py +551 -181
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-_7yox_eh.js +48 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/components-B7lKcHVY.js +140 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{entry.client-DX1misIU.js → entry.client-CEumGClk.js} +3 -3
- solace_agent_mesh/config_portal/frontend/static/client/assets/index-DSo1AH_7.js +68 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-e5c3acfe.js +1 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{root-BApq5dPK.js → root-C4XmHinv.js} +2 -2
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-DxRwaWiE.css +1 -0
- solace_agent_mesh/config_portal/frontend/static/client/index.html +3 -3
- solace_agent_mesh/core_a2a/__init__.py +1 -0
- solace_agent_mesh/core_a2a/core_a2a_llm.txt +88 -0
- solace_agent_mesh/core_a2a/service.py +331 -0
- solace_agent_mesh/evaluation/config_loader.py +657 -0
- solace_agent_mesh/evaluation/evaluator.py +667 -0
- solace_agent_mesh/evaluation/message_organizer.py +568 -0
- solace_agent_mesh/evaluation/report/benchmark_info.html +35 -0
- solace_agent_mesh/evaluation/report/chart_section.html +141 -0
- solace_agent_mesh/evaluation/report/detailed_breakdown.html +28 -0
- solace_agent_mesh/evaluation/report/modal.html +59 -0
- solace_agent_mesh/evaluation/report/modal_chart_functions.js +411 -0
- solace_agent_mesh/evaluation/report/modal_script.js +296 -0
- solace_agent_mesh/evaluation/report/modal_styles.css +340 -0
- solace_agent_mesh/evaluation/report/performance_metrics_styles.css +93 -0
- solace_agent_mesh/evaluation/report/templates/footer.html +2 -0
- solace_agent_mesh/evaluation/report/templates/header.html +340 -0
- solace_agent_mesh/evaluation/report_data_processor.py +972 -0
- solace_agent_mesh/evaluation/report_generator.py +613 -0
- solace_agent_mesh/evaluation/run.py +613 -0
- solace_agent_mesh/evaluation/subscriber.py +872 -0
- solace_agent_mesh/evaluation/summary_builder.py +775 -0
- solace_agent_mesh/evaluation/test_case_loader.py +714 -0
- solace_agent_mesh/gateway/base/__init__.py +1 -0
- solace_agent_mesh/gateway/base/app.py +266 -0
- solace_agent_mesh/gateway/base/base_llm.txt +119 -0
- solace_agent_mesh/gateway/base/component.py +1542 -0
- solace_agent_mesh/gateway/base/task_context.py +74 -0
- solace_agent_mesh/gateway/gateway_llm.txt +125 -0
- solace_agent_mesh/gateway/http_sse/app.py +190 -0
- solace_agent_mesh/gateway/http_sse/component.py +1602 -0
- solace_agent_mesh/gateway/http_sse/components/__init__.py +7 -0
- solace_agent_mesh/gateway/http_sse/components/components_llm.txt +65 -0
- solace_agent_mesh/gateway/http_sse/components/visualization_forwarder_component.py +108 -0
- solace_agent_mesh/gateway/http_sse/dependencies.py +316 -0
- solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +63 -0
- solace_agent_mesh/gateway/http_sse/main.py +442 -0
- solace_agent_mesh/gateway/http_sse/routers/__init__.py +4 -0
- solace_agent_mesh/gateway/http_sse/routers/agents.py +41 -0
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +827 -0
- solace_agent_mesh/gateway/http_sse/routers/auth.py +212 -0
- solace_agent_mesh/gateway/http_sse/routers/config.py +55 -0
- solace_agent_mesh/gateway/http_sse/routers/people.py +69 -0
- solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +37 -0
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +80 -0
- solace_agent_mesh/gateway/http_sse/routers/sse.py +138 -0
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +294 -0
- solace_agent_mesh/gateway/http_sse/routers/users.py +59 -0
- solace_agent_mesh/gateway/http_sse/routers/visualization.py +1131 -0
- solace_agent_mesh/gateway/http_sse/services/__init__.py +4 -0
- solace_agent_mesh/gateway/http_sse/services/agent_service.py +69 -0
- solace_agent_mesh/gateway/http_sse/services/people_service.py +158 -0
- solace_agent_mesh/gateway/http_sse/services/services_llm.txt +179 -0
- solace_agent_mesh/gateway/http_sse/services/task_service.py +121 -0
- solace_agent_mesh/gateway/http_sse/session_manager.py +187 -0
- solace_agent_mesh/gateway/http_sse/sse_manager.py +328 -0
- solace_agent_mesh/llm.txt +228 -0
- solace_agent_mesh/llm_detail.txt +2835 -0
- solace_agent_mesh/templates/agent_template.yaml +53 -0
- solace_agent_mesh/templates/eval_backend_template.yaml +54 -0
- solace_agent_mesh/templates/gateway_app_template.py +73 -0
- solace_agent_mesh/templates/gateway_component_template.py +431 -0
- solace_agent_mesh/templates/gateway_config_template.yaml +43 -0
- solace_agent_mesh/templates/logging_config_template.ini +64 -0
- solace_agent_mesh/templates/main_orchestrator.yaml +55 -0
- solace_agent_mesh/templates/plugin_agent_config_template.yaml +122 -0
- solace_agent_mesh/templates/plugin_custom_config_template.yaml +27 -0
- solace_agent_mesh/templates/plugin_custom_template.py +10 -0
- solace_agent_mesh/templates/plugin_gateway_config_template.yaml +63 -0
- solace_agent_mesh/templates/plugin_pyproject_template.toml +33 -0
- solace_agent_mesh/templates/plugin_readme_template.md +34 -0
- solace_agent_mesh/templates/plugin_tools_template.py +224 -0
- solace_agent_mesh/templates/shared_config.yaml +66 -0
- solace_agent_mesh/templates/templates_llm.txt +147 -0
- solace_agent_mesh/templates/webui.yaml +53 -0
- solace_agent_mesh-1.0.2.dist-info/METADATA +432 -0
- solace_agent_mesh-1.0.2.dist-info/RECORD +361 -0
- solace_agent_mesh-1.0.2.dist-info/entry_points.txt +3 -0
- {solace_agent_mesh-0.2.4.dist-info → solace_agent_mesh-1.0.2.dist-info}/licenses/LICENSE +1 -1
- solace_agent_mesh/agents/base_agent_component.py +0 -256
- solace_agent_mesh/agents/global/actions/agent_state_change.py +0 -54
- solace_agent_mesh/agents/global/actions/clear_history.py +0 -32
- solace_agent_mesh/agents/global/actions/convert_file_to_markdown.py +0 -160
- solace_agent_mesh/agents/global/actions/create_file.py +0 -70
- solace_agent_mesh/agents/global/actions/error_action.py +0 -45
- solace_agent_mesh/agents/global/actions/plantuml_diagram.py +0 -163
- solace_agent_mesh/agents/global/actions/plotly_graph.py +0 -152
- solace_agent_mesh/agents/global/actions/retrieve_file.py +0 -51
- solace_agent_mesh/agents/global/global_agent_component.py +0 -38
- solace_agent_mesh/agents/image_processing/actions/create_image.py +0 -75
- solace_agent_mesh/agents/image_processing/actions/describe_image.py +0 -115
- solace_agent_mesh/agents/image_processing/image_processing_agent_component.py +0 -23
- solace_agent_mesh/agents/slack/__init__.py +0 -1
- solace_agent_mesh/agents/slack/actions/__init__.py +0 -1
- solace_agent_mesh/agents/slack/actions/post_message.py +0 -177
- solace_agent_mesh/agents/slack/slack_agent_component.py +0 -59
- solace_agent_mesh/agents/web_request/actions/do_image_search.py +0 -84
- solace_agent_mesh/agents/web_request/actions/do_news_search.py +0 -47
- solace_agent_mesh/agents/web_request/actions/do_suggestion_search.py +0 -34
- solace_agent_mesh/agents/web_request/actions/do_web_request.py +0 -135
- solace_agent_mesh/agents/web_request/actions/download_file.py +0 -69
- solace_agent_mesh/agents/web_request/web_request_agent_component.py +0 -33
- solace_agent_mesh/assets/web-visualizer/assets/index-D0qORgkg.css +0 -1
- solace_agent_mesh/assets/web-visualizer/assets/index-DnDr1pnu.js +0 -109
- solace_agent_mesh/assets/web-visualizer/index.html +0 -14
- solace_agent_mesh/assets/web-visualizer/vite.svg +0 -1
- solace_agent_mesh/cli/commands/add/__init__.py +0 -3
- solace_agent_mesh/cli/commands/add/add.py +0 -88
- solace_agent_mesh/cli/commands/add/agent.py +0 -110
- solace_agent_mesh/cli/commands/add/copy_from_plugin.py +0 -92
- solace_agent_mesh/cli/commands/add/gateway.py +0 -374
- solace_agent_mesh/cli/commands/build.py +0 -670
- solace_agent_mesh/cli/commands/chat/__init__.py +0 -3
- solace_agent_mesh/cli/commands/chat/chat.py +0 -361
- solace_agent_mesh/cli/commands/config.py +0 -29
- solace_agent_mesh/cli/commands/init/__init__.py +0 -3
- solace_agent_mesh/cli/commands/init/ai_provider_step.py +0 -93
- solace_agent_mesh/cli/commands/init/broker_step.py +0 -99
- solace_agent_mesh/cli/commands/init/builtin_agent_step.py +0 -83
- solace_agent_mesh/cli/commands/init/check_if_already_done.py +0 -13
- solace_agent_mesh/cli/commands/init/create_config_file_step.py +0 -65
- solace_agent_mesh/cli/commands/init/create_other_project_files_step.py +0 -147
- solace_agent_mesh/cli/commands/init/file_service_step.py +0 -73
- solace_agent_mesh/cli/commands/init/init.py +0 -92
- solace_agent_mesh/cli/commands/init/project_structure_step.py +0 -16
- solace_agent_mesh/cli/commands/init/web_init_step.py +0 -32
- solace_agent_mesh/cli/commands/plugin/__init__.py +0 -3
- solace_agent_mesh/cli/commands/plugin/add.py +0 -100
- solace_agent_mesh/cli/commands/plugin/build.py +0 -268
- solace_agent_mesh/cli/commands/plugin/create.py +0 -117
- solace_agent_mesh/cli/commands/plugin/plugin.py +0 -124
- solace_agent_mesh/cli/commands/plugin/remove.py +0 -73
- solace_agent_mesh/cli/commands/run.py +0 -68
- solace_agent_mesh/cli/commands/visualizer.py +0 -138
- solace_agent_mesh/cli/config.py +0 -85
- solace_agent_mesh/common/action.py +0 -91
- solace_agent_mesh/common/action_list.py +0 -37
- solace_agent_mesh/common/action_response.py +0 -340
- solace_agent_mesh/common/mysql_database.py +0 -40
- solace_agent_mesh/common/postgres_database.py +0 -85
- solace_agent_mesh/common/prompt_templates.py +0 -28
- solace_agent_mesh/common/stimulus_utils.py +0 -152
- solace_agent_mesh/common/time.py +0 -24
- solace_agent_mesh/common/utils.py +0 -712
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-a-zJ6rLx.js +0 -46
- solace_agent_mesh/config_portal/frontend/static/client/assets/components-ZIfdTbrV.js +0 -191
- solace_agent_mesh/config_portal/frontend/static/client/assets/index-BJHAE5s4.js +0 -17
- solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-44c41103.js +0 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-DX4gQ516.css +0 -1
- solace_agent_mesh/configs/agent_global.yaml +0 -74
- solace_agent_mesh/configs/agent_image_processing.yaml +0 -82
- solace_agent_mesh/configs/agent_slack.yaml +0 -64
- solace_agent_mesh/configs/agent_web_request.yaml +0 -75
- solace_agent_mesh/configs/conversation_to_file.yaml +0 -56
- solace_agent_mesh/configs/error_catcher.yaml +0 -56
- solace_agent_mesh/configs/monitor.yaml +0 -0
- solace_agent_mesh/configs/monitor_stim_and_errors_to_slack.yaml +0 -109
- solace_agent_mesh/configs/monitor_user_feedback.yaml +0 -58
- solace_agent_mesh/configs/orchestrator.yaml +0 -241
- solace_agent_mesh/configs/service_embedding.yaml +0 -81
- solace_agent_mesh/configs/service_llm.yaml +0 -265
- solace_agent_mesh/configs/visualize_websocket.yaml +0 -55
- solace_agent_mesh/gateway/components/gateway_base.py +0 -47
- solace_agent_mesh/gateway/components/gateway_input.py +0 -278
- solace_agent_mesh/gateway/components/gateway_output.py +0 -298
- solace_agent_mesh/gateway/identity/bamboohr_identity.py +0 -18
- solace_agent_mesh/gateway/identity/identity_base.py +0 -10
- solace_agent_mesh/gateway/identity/identity_provider.py +0 -60
- solace_agent_mesh/gateway/identity/no_identity.py +0 -9
- solace_agent_mesh/gateway/identity/passthru_identity.py +0 -9
- solace_agent_mesh/monitors/base_monitor_component.py +0 -26
- solace_agent_mesh/monitors/feedback/user_feedback_monitor.py +0 -75
- solace_agent_mesh/monitors/stim_and_errors/stim_and_error_monitor.py +0 -560
- solace_agent_mesh/orchestrator/__init__.py +0 -0
- solace_agent_mesh/orchestrator/action_manager.py +0 -237
- solace_agent_mesh/orchestrator/components/__init__.py +0 -0
- solace_agent_mesh/orchestrator/components/orchestrator_action_manager_timeout_component.py +0 -58
- solace_agent_mesh/orchestrator/components/orchestrator_action_response_component.py +0 -179
- solace_agent_mesh/orchestrator/components/orchestrator_register_component.py +0 -107
- solace_agent_mesh/orchestrator/components/orchestrator_stimulus_processor_component.py +0 -527
- solace_agent_mesh/orchestrator/components/orchestrator_streaming_output_component.py +0 -260
- solace_agent_mesh/orchestrator/orchestrator_main.py +0 -172
- solace_agent_mesh/orchestrator/orchestrator_prompt.py +0 -539
- solace_agent_mesh/services/__init__.py +0 -0
- solace_agent_mesh/services/authorization/providers/base_authorization_provider.py +0 -56
- solace_agent_mesh/services/bamboo_hr_service/__init__.py +0 -3
- solace_agent_mesh/services/bamboo_hr_service/bamboo_hr.py +0 -182
- solace_agent_mesh/services/common/__init__.py +0 -4
- solace_agent_mesh/services/common/auto_expiry.py +0 -45
- solace_agent_mesh/services/common/singleton.py +0 -18
- solace_agent_mesh/services/file_service/__init__.py +0 -14
- solace_agent_mesh/services/file_service/file_manager/__init__.py +0 -0
- solace_agent_mesh/services/file_service/file_manager/bucket_file_manager.py +0 -149
- solace_agent_mesh/services/file_service/file_manager/file_manager_base.py +0 -162
- solace_agent_mesh/services/file_service/file_manager/memory_file_manager.py +0 -64
- solace_agent_mesh/services/file_service/file_manager/volume_file_manager.py +0 -106
- solace_agent_mesh/services/file_service/file_service.py +0 -437
- solace_agent_mesh/services/file_service/file_service_constants.py +0 -54
- solace_agent_mesh/services/file_service/file_transformations.py +0 -141
- solace_agent_mesh/services/file_service/file_utils.py +0 -324
- solace_agent_mesh/services/file_service/transformers/__init__.py +0 -5
- solace_agent_mesh/services/history_service/__init__.py +0 -3
- solace_agent_mesh/services/history_service/history_providers/__init__.py +0 -0
- solace_agent_mesh/services/history_service/history_providers/base_history_provider.py +0 -54
- solace_agent_mesh/services/history_service/history_providers/file_history_provider.py +0 -74
- solace_agent_mesh/services/history_service/history_providers/index.py +0 -40
- solace_agent_mesh/services/history_service/history_providers/memory_history_provider.py +0 -33
- solace_agent_mesh/services/history_service/history_providers/mongodb_history_provider.py +0 -66
- solace_agent_mesh/services/history_service/history_providers/redis_history_provider.py +0 -66
- solace_agent_mesh/services/history_service/history_providers/sql_history_provider.py +0 -93
- solace_agent_mesh/services/history_service/history_service.py +0 -413
- solace_agent_mesh/services/history_service/long_term_memory/__init__.py +0 -0
- solace_agent_mesh/services/history_service/long_term_memory/long_term_memory.py +0 -399
- solace_agent_mesh/services/llm_service/components/llm_request_component.py +0 -340
- solace_agent_mesh/services/llm_service/components/llm_service_component_base.py +0 -152
- solace_agent_mesh/services/middleware_service/__init__.py +0 -0
- solace_agent_mesh/services/middleware_service/middleware_service.py +0 -20
- solace_agent_mesh/templates/action.py +0 -38
- solace_agent_mesh/templates/agent.py +0 -29
- solace_agent_mesh/templates/agent.yaml +0 -70
- solace_agent_mesh/templates/gateway-config-template.yaml +0 -6
- solace_agent_mesh/templates/gateway-default-config.yaml +0 -28
- solace_agent_mesh/templates/gateway-flows.yaml +0 -78
- solace_agent_mesh/templates/gateway-header.yaml +0 -16
- solace_agent_mesh/templates/gateway_base.py +0 -15
- solace_agent_mesh/templates/gateway_input.py +0 -98
- solace_agent_mesh/templates/gateway_output.py +0 -71
- solace_agent_mesh/templates/plugin-gateway-default-config.yaml +0 -29
- solace_agent_mesh/templates/plugin-pyproject.toml +0 -30
- solace_agent_mesh/templates/rest-api-default-config.yaml +0 -31
- solace_agent_mesh/templates/rest-api-flows.yaml +0 -81
- solace_agent_mesh/templates/slack-default-config.yaml +0 -16
- solace_agent_mesh/templates/slack-flows.yaml +0 -81
- solace_agent_mesh/templates/solace-agent-mesh-default.yaml +0 -86
- solace_agent_mesh/templates/solace-agent-mesh-plugin-default.yaml +0 -8
- solace_agent_mesh/templates/web-default-config.yaml +0 -10
- solace_agent_mesh/templates/web-flows.yaml +0 -76
- solace_agent_mesh/tools/__init__.py +0 -0
- solace_agent_mesh/tools/components/__init__.py +0 -0
- solace_agent_mesh/tools/components/conversation_formatter.py +0 -111
- solace_agent_mesh/tools/components/file_resolver_component.py +0 -58
- solace_agent_mesh/tools/config/runtime_config.py +0 -26
- solace_agent_mesh-0.2.4.dist-info/METADATA +0 -176
- solace_agent_mesh-0.2.4.dist-info/RECORD +0 -193
- solace_agent_mesh-0.2.4.dist-info/entry_points.txt +0 -3
- /solace_agent_mesh/{agents → agent}/__init__.py +0 -0
- /solace_agent_mesh/{agents/global → agent/adk}/__init__.py +0 -0
- /solace_agent_mesh/{agents/global/actions → agent/protocol}/__init__.py +0 -0
- /solace_agent_mesh/{agents/image_processing → agent/sac}/__init__.py +0 -0
- /solace_agent_mesh/{agents/image_processing/actions → agent/utils}/__init__.py +0 -0
- /solace_agent_mesh/{agents/web_request → config_portal/backend/plugin_catalog}/__init__.py +0 -0
- /solace_agent_mesh/{agents/web_request/actions → evaluation}/__init__.py +0 -0
- /solace_agent_mesh/gateway/{components → http_sse}/__init__.py +0 -0
- {solace_agent_mesh-0.2.4.dist-info → solace_agent_mesh-1.0.2.dist-info}/WHEEL +0 -0
|
@@ -1,539 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, List
|
|
2
|
-
import yaml
|
|
3
|
-
from ..services.file_service import FS_PROTOCOL, Types, LLM_QUERY_OPTIONS, TRANSFORMERS
|
|
4
|
-
from solace_ai_connector.common.log import log
|
|
5
|
-
|
|
6
|
-
# Cap the number of examples so we don't overwhelm the LLM
|
|
7
|
-
MAX_SYSTEM_PROMPT_EXAMPLES = 6
|
|
8
|
-
|
|
9
|
-
# Examples that should always be included in the prompt
|
|
10
|
-
fixed_examples = [
|
|
11
|
-
{
|
|
12
|
-
"docstring": "This example shows a stimulus from a chatbot gateway in which a user is asking about the top stories on the website hacker news. The web_request is not yet open, so the change_agent_status action is invoked to open the web_request agent.",
|
|
13
|
-
"tag_prefix_placeholder": "{tp}",
|
|
14
|
-
"starting_id": "1",
|
|
15
|
-
"user_input": "What is the top story on hacker news?",
|
|
16
|
-
"metadata": ["local_time: 2024-11-06 15:58:04 EST-0500 (Wednesday)"],
|
|
17
|
-
"reasoning": [
|
|
18
|
-
"- User is asking for the top story on Hacker News",
|
|
19
|
-
"- We need to use the web_request agent to fetch the latest information",
|
|
20
|
-
"- The web_request agent is currently closed, so we need to open it first",
|
|
21
|
-
"- After opening the agent, we'll need to make a web request to Hacker News",
|
|
22
|
-
],
|
|
23
|
-
"response_text": "",
|
|
24
|
-
"status_update": "To get the latest top story from Hacker News, I'll need to access the web. I'm preparing to do that now.",
|
|
25
|
-
"action": {
|
|
26
|
-
"agent": "global",
|
|
27
|
-
"name": "change_agent_status",
|
|
28
|
-
"parameters": {"agent_name": "web_request", "new_state": "open"},
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def get_file_handling_prompt(tp: str) -> str:
|
|
35
|
-
parameters_desc = ""
|
|
36
|
-
parameter_examples = ""
|
|
37
|
-
|
|
38
|
-
for transformer in TRANSFORMERS:
|
|
39
|
-
if transformer.description:
|
|
40
|
-
parameters_desc += "\n" + transformer.description.strip() + "\n"
|
|
41
|
-
|
|
42
|
-
if transformer.examples:
|
|
43
|
-
for example in transformer.examples:
|
|
44
|
-
parameter_examples += "\n" + example.strip() + "\n"
|
|
45
|
-
|
|
46
|
-
parameters_desc = "\n ".join(parameters_desc.split("\n"))
|
|
47
|
-
parameter_examples = "\n ".join(parameter_examples.split("\n"))
|
|
48
|
-
|
|
49
|
-
parameters_desc = parameters_desc.replace("{tp}", tp)
|
|
50
|
-
parameter_examples = parameter_examples.replace("{tp}", tp)
|
|
51
|
-
|
|
52
|
-
if parameter_examples:
|
|
53
|
-
parameter_examples = f"""
|
|
54
|
-
Here are some examples of how to use the query parameters:
|
|
55
|
-
{parameter_examples}"""
|
|
56
|
-
|
|
57
|
-
prompt = f"""
|
|
58
|
-
XML tags are used to represent files. The assistant will use the <{tp}file> tag to represent a file. The file tag has the following format:
|
|
59
|
-
<{tp}file name="filename" mime_type="mimetype" size="size in bytes">
|
|
60
|
-
<schema-yaml>...JSON schema, yaml format...</schema-yaml> (optional)
|
|
61
|
-
<shape>...textual description of the shape of the data (type dependent)...</shape> (optional)
|
|
62
|
-
<url> URL to download the file </url> or <data> The data content if it's small </data>
|
|
63
|
-
<data-source> the origin of the data </data-source> (optional)
|
|
64
|
-
</{tp}file>
|
|
65
|
-
|
|
66
|
-
- schema-yaml is optional, but when present it gives insight into the structure of the data in the file. It can be used to create URL query parameters.
|
|
67
|
-
- shape is optional, but when present it gives contextual information about the content.
|
|
68
|
-
- A file either has a URL or data content, but not both. The URL can be used to download the file content. You can not create a new URL.
|
|
69
|
-
|
|
70
|
-
Here's an example of a file with URL.
|
|
71
|
-
|
|
72
|
-
<{tp}file name="filename.csv" mime_type="text/csv" size="1024">
|
|
73
|
-
<url>{FS_PROTOCOL}://da2b679f-4474-4350-92c9-89c9691ab902_filename.csv</url>
|
|
74
|
-
<schema-yaml>
|
|
75
|
-
type: {Types.ARRAY}
|
|
76
|
-
items:
|
|
77
|
-
type: {Types.OBJECT}
|
|
78
|
-
properties:
|
|
79
|
-
id:
|
|
80
|
-
type: {Types.INT}
|
|
81
|
-
firstname:
|
|
82
|
-
type: {Types.STR}
|
|
83
|
-
lastname:
|
|
84
|
-
type: {Types.STR}
|
|
85
|
-
age:
|
|
86
|
-
type: {Types.INT}
|
|
87
|
-
</schema-yaml>
|
|
88
|
-
<shape>120 rows x 4 columns</shape>
|
|
89
|
-
</{tp}file>
|
|
90
|
-
|
|
91
|
-
The assistant can partially load the data by using query parameters in the URL. These parameters are file specific.
|
|
92
|
-
{parameters_desc}
|
|
93
|
-
For all files, there's `encoding` parameter, this is used to encode the file format. The supported values are `datauri`, `base64`, `zip`, and `gzip`. Use this to convert a file to ZIP or datauri for HTML encoding.
|
|
94
|
-
For example (return a file as zip): `{FS_PROTOCOL}://c27e6908-55d5-4ce0-bc93-a8e28f84be12_annual_report.csv?encoding=zip&resolve=true`
|
|
95
|
-
Example 2 (HTML tag must be datauri encoded): `<img src="{FS_PROTOCOL}://c9183b0f-fd11-48b4-ad8f-df221bff3da9_generated_image.png?encoding=datauri&resolve=true" alt="image">`
|
|
96
|
-
Example 3 (return a regular image directly): `{FS_PROTOCOL}://a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p_photo.png?resolve=true` - When returning images directly in messaging platforms like Slack, don't use any encoding parameter
|
|
97
|
-
|
|
98
|
-
For all files, there's `resolve=true` parameter, this is used to resolve the url to the actual data before processing.
|
|
99
|
-
For example: `{FS_PROTOCOL}://577c928c-c126-42d8-8a48-020b93096110_names.csv?resolve=true`
|
|
100
|
-
|
|
101
|
-
If the assistant needs to only send the value of the data to an agent or the gateway, it can use the `resolve` parameter which will replace the whole url with the data content. No quotation is required when using the `resolve` parameter.
|
|
102
|
-
|
|
103
|
-
For the URLs that have spaces in the query parameters wrap the URL in `<url>` tags.
|
|
104
|
-
|
|
105
|
-
The assistant can either pass the whole file block or just the URL to the gateway or the agent depending on the context and specified requirements.
|
|
106
|
-
When using a {FS_PROTOCOL} URL outside of a file block, always include the 'resolve=true' query parameter to ensure the URL is resolved to the actual data.
|
|
107
|
-
|
|
108
|
-
When talking about a file, use the file name instead of the URL. The URL should be used when trying to access the file.
|
|
109
|
-
|
|
110
|
-
If you need to directly access the content of a text file, use the `retrieve_file` action from the global agent. The action will return the content of the file in the response. If you don't need the content or if you think the user query can be answered with query parameters (eg jq), you can send the url back to the gateway with 'resolve=true'.
|
|
111
|
-
|
|
112
|
-
To create a new persistent file, use the `create_file` action from the global agent. The action will create a new file with the specified content and return the file block in the response. Don't create a file from a URL file block, just use the reference to the file block. Avoid using `create_file` action as much as possible. Prioritize using the query parameters to format the file.
|
|
113
|
-
|
|
114
|
-
If you need to create a non-persistent temporary file, you should use the <data> tag to represent the content of the file.
|
|
115
|
-
For example, if the assistant needs to create a CSV file with the following content:
|
|
116
|
-
id,firstname,lastname,age
|
|
117
|
-
1,John,Doe,30
|
|
118
|
-
2,Jane,Doe,25
|
|
119
|
-
3,James,Smith,40
|
|
120
|
-
|
|
121
|
-
The assistant can use the following response:
|
|
122
|
-
<{tp}file name="employee_info.csv" mime_type="text/csv">
|
|
123
|
-
<data>id,firstname,lastname,age\n1,John,Doe,30\n2,Jane,Doe,25\n3,James,Smith,40\n</data>
|
|
124
|
-
</{tp}file>
|
|
125
|
-
|
|
126
|
-
Note: You can't nest `<{tp}file>` tags inside the `<data>` tag. If you need to address another file within the data, use the URL with the `resolve=true` query parameter.
|
|
127
|
-
|
|
128
|
-
Try avoid creating a persistent file if you can respond with file block with data tags.
|
|
129
|
-
When responding to the gateway, both <url>...</url> or <data>...</data> can be used in <{tp}file> elements. If the data is already available as a url, it is preferred to use that url in replying to the gateway. When the url is used, it is acceptable to use query parameters to select a subset of the file. The system will expand the <url> form to actual data before it reaches the gateway.
|
|
130
|
-
|
|
131
|
-
Never return the bare {FS_PROTOCOL} URL (without 'resolve' query parameter) as a link to the gateway. Always put it in at <{tp}file> tag so the system can handle it properly.
|
|
132
|
-
|
|
133
|
-
{parameter_examples}
|
|
134
|
-
"""
|
|
135
|
-
return prompt
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def create_examples(
|
|
139
|
-
fixed_examples: List[str], agent_examples: List[str], tp: str
|
|
140
|
-
) -> str:
|
|
141
|
-
"""Create examples string with replaced tag prefix placeholders.
|
|
142
|
-
|
|
143
|
-
Args:
|
|
144
|
-
examples: List of example strings containing {tp} placeholders
|
|
145
|
-
tp: Tag prefix to replace placeholders with
|
|
146
|
-
|
|
147
|
-
Returns:
|
|
148
|
-
String containing all examples with replaced placeholders
|
|
149
|
-
"""
|
|
150
|
-
examples = (fixed_examples + agent_examples)[:MAX_SYSTEM_PROMPT_EXAMPLES]
|
|
151
|
-
formatted_examples = format_examples_by_llm_type(examples)
|
|
152
|
-
|
|
153
|
-
return "\n".join([example.replace("{tp}", tp) for example in formatted_examples])
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
def SystemPrompt(info: Dict[str, Any], action_examples: List[str]) -> str:
|
|
157
|
-
tp = info["tag_prefix"]
|
|
158
|
-
response_format_prompt = info.get("response_format_prompt", "") or ""
|
|
159
|
-
response_format_prompt = response_format_prompt.replace("{{tag_prefix}}", tp)
|
|
160
|
-
response_guidelines_prompt = (
|
|
161
|
-
f"<response_guidelines>\nConsider the following when generating a response to the originator:\n"
|
|
162
|
-
f"{response_format_prompt}</response_guidelines>"
|
|
163
|
-
if response_format_prompt
|
|
164
|
-
else ""
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
available_files = ""
|
|
168
|
-
if (
|
|
169
|
-
info.get("available_files")
|
|
170
|
-
and info.get("available_files") is not None
|
|
171
|
-
and len(info["available_files"]) > 0
|
|
172
|
-
):
|
|
173
|
-
blocks = "\n\n".join(info["available_files"])
|
|
174
|
-
available_files = (
|
|
175
|
-
"\n<available_files>\n"
|
|
176
|
-
"The following files are available for access, only use them if needed:\n"
|
|
177
|
-
f"\n{blocks}\n"
|
|
178
|
-
"</available_files>\n"
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
# Merged
|
|
182
|
-
examples = create_examples(fixed_examples, action_examples, tp)
|
|
183
|
-
|
|
184
|
-
handling_files = get_file_handling_prompt(tp)
|
|
185
|
-
|
|
186
|
-
return f"""
|
|
187
|
-
Note to avoid unintended collisions, all tag names in the assistant response will start with the value `{tp}`
|
|
188
|
-
<orchestrator_info>
|
|
189
|
-
You are an assistant serving as the orchestrator in an AI agentic system. Your primary functions are to:
|
|
190
|
-
1. Receive stimuli from external sources via the system Gateway
|
|
191
|
-
2. Invoke actions within system agents to address these stimuli
|
|
192
|
-
3. Formulate responses based on agent actions
|
|
193
|
-
|
|
194
|
-
This process is iterative, where the assistant is reinvoked at each step.
|
|
195
|
-
|
|
196
|
-
The Stimulus represents user or application requests.
|
|
197
|
-
|
|
198
|
-
The assistant receives a history of all gateway-orchestrator exchanges, excluding responses from agents' action invocations and reasoning. Don't use this as a guide for the responses.
|
|
199
|
-
|
|
200
|
-
The assistant's behavior aligns with the system purpose specified below:
|
|
201
|
-
<system_purpose>
|
|
202
|
-
{info["system_purpose"]}
|
|
203
|
-
</system_purpose>
|
|
204
|
-
<orchestrator_rules>
|
|
205
|
-
The assistant (in the role of orchestrator) will:
|
|
206
|
-
- Manage system agents by opening and closing them as needed:
|
|
207
|
-
1. When opening an agent, its available actions will be listed.
|
|
208
|
-
2. If closed agents are needed for the next step, open only the required agents.
|
|
209
|
-
3. After opening agents, the assistant will be reinvoked with an updated list of open agents and their actions.
|
|
210
|
-
4. When opening an agent, provide only a brief status update without detailed explanations.
|
|
211
|
-
5. Do not perform any other actions besides opening the required agents in this step.
|
|
212
|
-
6. All `{tp}` XML tags must be generated as raw text directly within the response stream, seamlessly integrated with any natural language text, as shown in the positive examples.
|
|
213
|
-
7. Crucially, `{tp}` directive tags must *never* be wrapped in markdown code fences (``` ```) of any kind, including ```xml.
|
|
214
|
-
- Report generation:
|
|
215
|
-
1. If a report is requested and no format is specified, create the report in an HTML file.
|
|
216
|
-
2. Generate each section of the report independently and store it in the file service with create_file action. When finishing the report, combine the sections using {FS_PROTOCOL} urls with the resolve=true query parameter to insert the sections into the main document. When inserting {FS_PROTOCOL} HTML URLs into the HTML document, place them directly in the document without any surrounding tags or brackets. Here is an example of the body section of an HTML report combining multiple sections:
|
|
217
|
-
<body>
|
|
218
|
-
<!-- Title -->
|
|
219
|
-
<h1>Report Title</h1>
|
|
220
|
-
|
|
221
|
-
<!-- Section 1 -->
|
|
222
|
-
{FS_PROTOCOL}://xxxxxx.html?resolve=true
|
|
223
|
-
|
|
224
|
-
<!-- Section 2 -->
|
|
225
|
-
{FS_PROTOCOL}://yyyyyy.html?resolve=true
|
|
226
|
-
|
|
227
|
-
<!-- Section 3 -->
|
|
228
|
-
{FS_PROTOCOL}://zzzzzz.html?resolve=true
|
|
229
|
-
</body>
|
|
230
|
-
When generating HTML, create the header first with all the necessary CSS and JS links so that it is clear what css the rest of the document will use.
|
|
231
|
-
3. Images are always very useful in reports, so the assistant will add them when appropriate. If images are embedded in html, they must be resolved and converted to datauri format or they won't render in the final document. This can be done by using the encoding=datauri&resolve=true in the {FS_PROTOCOL} link. For example, <img src="{FS_PROTOCOL}://xxxxxx.png?encoding=datauri&resolve=true">. The assistant will take care of the rest. Images can be created in parallel
|
|
232
|
-
4. During report generation in interactive sessions, the assistant will send lots of status messages to indicate what is happening.
|
|
233
|
-
- Handling stimuli with open agents:
|
|
234
|
-
1. Use agents' actions to break down the stimulus into smaller, manageable tasks.
|
|
235
|
-
2. Invoke agents' actions to perform these tasks
|
|
236
|
-
3. After invoking an action with the invoke action directive, finish the response and wait for the action to complete.
|
|
237
|
-
4. The action will be run and the results will then be returned on a later step. NEVER guess or fill in the response without waiting for the action's response.
|
|
238
|
-
5. Prioritize using available actions to fulfill the stimulus whenever possible.
|
|
239
|
-
6. If no suitable agents or actions are available, the assistant will:
|
|
240
|
-
a) Use its own knowledge to respond, or
|
|
241
|
-
b) Ask the user for additional information, or
|
|
242
|
-
c) Inform the user that it cannot fulfill the request.
|
|
243
|
-
- The first user message contains the history of all exchanges between the gateway and the orchestrator before now. Note that this history list has removed all the agent's action invocation outputs and reasoning.
|
|
244
|
-
- Do not use the history as a guide for how to respond. That history is only present to provide some context to the coversation. The format and data have been modified and does not show all the assistant's directives.
|
|
245
|
-
- The assistant will not guess at an answer. No answer is better than a wrong answer.
|
|
246
|
-
- The assistant will invoke the actions and specify the parameters for each action, following the rules of the action. If there is not sufficient context to fill in an action parameter, the assistant will ask the user for more information.
|
|
247
|
-
- After invoking the actions, the assistant will end the response and wait for the action responses. It will not guess at the answers.
|
|
248
|
-
- The assistant will NEVER invoke an action that is not listed in the open agents. This will fail and waste money.
|
|
249
|
-
- All text outside of the <{tp}...> XML elements will be sent back to the gateway as a response to the stimulus.
|
|
250
|
-
- If the <{tp}errors> XML element is present, the assistant will send the errors back to the gateway and the conversation will be ended.
|
|
251
|
-
- Structure the response beginning:
|
|
252
|
-
1. Start each response with a <{tp}reasoning> tag.
|
|
253
|
-
2. Within this tag, include:
|
|
254
|
-
a) A brief list of points describing the plan and thoughts.
|
|
255
|
-
b) A list of potential actions needed to fulfill the stimulus.
|
|
256
|
-
c) Always include a statement that the assistant will not follow invoke actions with any other output.
|
|
257
|
-
3. Ensure all content is contained within the <{tp}reasoning> tag.
|
|
258
|
-
4. Keep each point concise and focused.
|
|
259
|
-
- For large grouped output, such as a list of items or a big code block (> 10 lines), the assistant will create a file by surrounding the output with the tags <{tp}file name="filename" mime_type="mimetype"><data> the content </data></{tp}file>. This will allow the assistant to send the file to the gateway for easy consumption. This works well for a csv file, a code file or just a big text file.
|
|
260
|
-
- When the assistant invokes an action that retrieves external knowledge (e.g. Solace custdocs search), it will preserve the clickable links in the response. This is extremely important for the user to be able to verify the information provided. This is true for web requests as well. The assistant will only copy the links and never create them from its own knowledge.
|
|
261
|
-
- If the agent has access to a web request agent, it will use the web request agent in cases where up-to-date information is required. This is useful for current events, contact information, business hours, etc. Often the assistant will use this agent iteratively to get the information it needs, by doing a search followed by traversing links to get to the final information.
|
|
262
|
-
- The assistant is able to invoke multiple actions in parallel within a single response. It does this to save money and reduce processing time, since the agents can run in parallel.
|
|
263
|
-
- When the stimulus asks what the system can do, the assistant will open all the agents to see their details before creating a nicely formatted list describing the actions available and indicating that it can do normal chatbot things as well. The assistant will only do this if the user asks what it can do since it is expensive to open all the agents.
|
|
264
|
-
- The assistant is concise and professional in its responses. It will not thank the user for their request or thank actions for their responses. It will not provide any unnecessary information in its responses.
|
|
265
|
-
- The assistant will not follow invoke_actions with further comments or explanations
|
|
266
|
-
- After outputing the invoke action tags, the assistant will not add any additional text. It will just end the response always.
|
|
267
|
-
- The assistant will distinguish between normal text and status updates. All status updates will be enclosed in <{tp}status_update/> tags.
|
|
268
|
-
- Responses that are just letting the originator know that progress is being made or what the next step is should be status updates. They should be brief and to the point.
|
|
269
|
-
<action_rules>
|
|
270
|
-
1. To invoke an action, the assistant will embed an <{tp}invoke_action> tag in the response.
|
|
271
|
-
2. The <{tp}invoke_action> tag has the following format:
|
|
272
|
-
<{tp}invoke_action agent="agent_id" action="action_id">
|
|
273
|
-
<{tp}parameter name="parameter_name">parameter_value</{tp}parameter>
|
|
274
|
-
...
|
|
275
|
-
</{tp}invoke_action>
|
|
276
|
-
3. Agents and their actions do not maintain state between invocations. The assistant must provide full context for each action invocation.
|
|
277
|
-
4. There can be multiple <{tp}invoke_action> tags in the response. All actions will be invoked in parallel, so the order is not guaranteed.
|
|
278
|
-
5. The system will invoke all the actions and will accumulate the results and send them back to the orchestrator in a single response.
|
|
279
|
-
6. When the assistant returns the response that has no <{tp}invoke_action> tags, the result will be returned to the gateway and the conversation will be ended.
|
|
280
|
-
7. Conversation history will be maintained for the full duration of the stimulus processing. This includes all the responses from the assistant and the user.
|
|
281
|
-
8. To open or close an agent, the assistant will invoke the change_agent_status action within the 'global' agent.
|
|
282
|
-
9. The assistant will only choose actions from the list of open agents.
|
|
283
|
-
</action_rules>
|
|
284
|
-
</orchestrator_rules>
|
|
285
|
-
<handling_files>
|
|
286
|
-
{handling_files}
|
|
287
|
-
</handling_files>
|
|
288
|
-
</orchestrator_info>
|
|
289
|
-
|
|
290
|
-
<agents-in-yaml>
|
|
291
|
-
{info["agent_state_yaml"]}
|
|
292
|
-
</agents-in-yaml>
|
|
293
|
-
|
|
294
|
-
<examples>
|
|
295
|
-
{examples}
|
|
296
|
-
</examples>
|
|
297
|
-
|
|
298
|
-
<stimulus_originator_metadata>
|
|
299
|
-
{info["originator_info_yaml"]}
|
|
300
|
-
</stimulus_originator_metadata>
|
|
301
|
-
{available_files}
|
|
302
|
-
|
|
303
|
-
{response_guidelines_prompt}
|
|
304
|
-
"""
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
def UserStimulusPrompt(
|
|
308
|
-
info: dict, gateway_history: list, errors: list, has_files
|
|
309
|
-
) -> str:
|
|
310
|
-
full_input = info.get("input", {})
|
|
311
|
-
stimulus = full_input.get("originator_input", "")
|
|
312
|
-
current_time = full_input.get("current_time_iso", "")
|
|
313
|
-
|
|
314
|
-
# Determine what (if any) gateway history to include in the prompt
|
|
315
|
-
gateway_history_str = ""
|
|
316
|
-
for item in gateway_history:
|
|
317
|
-
if item.get("role") == "user":
|
|
318
|
-
gateway_history_str += (
|
|
319
|
-
f"\n<{info['tag_prefix']}stimulus>\n"
|
|
320
|
-
f"{item.get('content')}\n"
|
|
321
|
-
f"</{info['tag_prefix']}stimulus>\n"
|
|
322
|
-
)
|
|
323
|
-
elif item.get("role") == "assistant":
|
|
324
|
-
gateway_history_str += (
|
|
325
|
-
f"... Removed orchestrator/assistant processing history ...\n"
|
|
326
|
-
f"<{info['tag_prefix']}stimulus_response>\n"
|
|
327
|
-
f"{item.get('content')}\n"
|
|
328
|
-
f"</{info['tag_prefix']}stimulus_response>\n"
|
|
329
|
-
)
|
|
330
|
-
|
|
331
|
-
if gateway_history_str:
|
|
332
|
-
gateway_history_str = (
|
|
333
|
-
f"\n<{info['tag_prefix']}stimulus_history>\n"
|
|
334
|
-
f"{gateway_history_str}\n"
|
|
335
|
-
f"</{info['tag_prefix']}stimulus_history>\n"
|
|
336
|
-
)
|
|
337
|
-
|
|
338
|
-
query_options = ", ".join(
|
|
339
|
-
[f"`{key}:{value}" for key, value in LLM_QUERY_OPTIONS.items()]
|
|
340
|
-
)
|
|
341
|
-
file_instructions = (
|
|
342
|
-
f"\n<{info['tag_prefix']}file_instructions> Only use the `retrieve_file` action if you absolutely need the content of the file. "
|
|
343
|
-
"Prioritize using the query parameters to get access the content of the file. You don't need to retrieve the file, if you can just return the URL with query parameters. "
|
|
344
|
-
f"Available query parameters are {query_options}."
|
|
345
|
-
"In most cases, you'd only need to return the file block to the gateway.\n\n"
|
|
346
|
-
f"You can return a {FS_PROTOCOL} URL (with optional query parameters) using the format <{info['tag_prefix']}file><url> URL </url></{info['tag_prefix']}file>.\n"
|
|
347
|
-
f"\tExample of returning a file as zip: <{info['tag_prefix']}file><url>{FS_PROTOCOL}://519321d8-3506-4f8d-9377-e5d6ce74d917_filename.csv?encoding=zip</url></{info['tag_prefix']}file>.\n"
|
|
348
|
-
f"You can also optionally return a non-persistent temporary file using the format <{info['tag_prefix']}file name=\"filename.csv\" mime_type=\"text/csv\">\n<data> data </data>\n</{info['tag_prefix']}file>.\n"
|
|
349
|
-
f" can't nest `<{info['tag_prefix']}file>` tags inside the `<data>` tag. If you need to address another file within the data, use the URL with the `resolve=true` query parameter.\n"
|
|
350
|
-
f"When using a {FS_PROTOCOL} URL outside of a file block, always include the 'resolve=true' query parameter to ensure the URL is resolved to the actual data.\n"
|
|
351
|
-
f"</{info['tag_prefix']}file_instructions>"
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
prompt = (
|
|
355
|
-
"NOTE - this history represents the conversation as seen by the user on the other side of the gateway. It does not include the responses from invoked actions or reasoning. All of that has been removed, so don't use this history as an example for how the assistant should behave\n"
|
|
356
|
-
f"{gateway_history_str}\n"
|
|
357
|
-
f"<{info['tag_prefix']}stimulus>\n"
|
|
358
|
-
f"{stimulus}\n"
|
|
359
|
-
f"</{info['tag_prefix']}stimulus>\n"
|
|
360
|
-
f"<{info['tag_prefix']}stimulus_metadata>\n"
|
|
361
|
-
f"local_time: {current_time}\n"
|
|
362
|
-
f"</{info['tag_prefix']}stimulus_metadata>\n"
|
|
363
|
-
)
|
|
364
|
-
|
|
365
|
-
if has_files:
|
|
366
|
-
prompt += file_instructions
|
|
367
|
-
|
|
368
|
-
if len(errors) > 0:
|
|
369
|
-
prompt += (
|
|
370
|
-
f"\n<{info['tag_prefix']}errors>\n"
|
|
371
|
-
"Encountered the following errors while processing the stimulus:\n"
|
|
372
|
-
f"{errors}\n"
|
|
373
|
-
f"</{info['tag_prefix']}errors>\n"
|
|
374
|
-
)
|
|
375
|
-
|
|
376
|
-
return prompt
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
def ActionResponsePrompt(prompt_info: dict) -> str:
|
|
380
|
-
tp = prompt_info["tag_prefix"]
|
|
381
|
-
return (
|
|
382
|
-
f"\n<{tp}action_response>\n"
|
|
383
|
-
f"<{tp}note>This is the agent's response from the assistant's request. The assistant will not thank anyone for these results. Thanking for the results will confuse the originator of the request because they don't see the interaction between the assistant and the agents performing the actions.</{tp}note>\n"
|
|
384
|
-
f"{prompt_info['input']}\n"
|
|
385
|
-
f"</{tp}action_response>\n"
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
def BasicRagPrompt(
|
|
390
|
-
context_source: str, query: str, context: Dict[str, Any], input_type: str
|
|
391
|
-
) -> str:
|
|
392
|
-
return f"""
|
|
393
|
-
You are doing Retrieval Augmented Generation (RAG) on the {context_source} information to answer the following query:
|
|
394
|
-
<user_query>
|
|
395
|
-
{query}
|
|
396
|
-
</user_query>
|
|
397
|
-
|
|
398
|
-
You will use the RAG model to generate an answer to the query. The answer should be returned with a send_message action.
|
|
399
|
-
Do not do another query as part of the response to this. Either use the context provided or let the originator know that
|
|
400
|
-
there is not enough information to answer the query.
|
|
401
|
-
|
|
402
|
-
The context to use to answer the query is shown below. For any context you use, ensure that there is a link to the
|
|
403
|
-
source of the context. The link must be in the appropriate format slack or web the web format is: '[' <link-text> '](' <url> ']' and the slack format is: '<' <url> '|' <link-text> '>'. This message should be formatted in the {input_type} format.
|
|
404
|
-
Be very careful about your answer since it will be used in a professional setting and their
|
|
405
|
-
reputation is on the line.
|
|
406
|
-
|
|
407
|
-
<context_yaml>
|
|
408
|
-
{yaml.dump(context)}
|
|
409
|
-
</context_yaml>
|
|
410
|
-
"""
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
def ContextQueryPrompt(query: str, context: str) -> str:
|
|
414
|
-
return f"""
|
|
415
|
-
You (orchestrator) are being asked to query, comment on or edit the following text following the originator's request.
|
|
416
|
-
Do your best to give a complete and accurate answer using only the context given below. Ensure that you
|
|
417
|
-
include links to the source of the information.
|
|
418
|
-
|
|
419
|
-
Do not make up information. If the context does not include the information you need just say that you
|
|
420
|
-
can't answer the question. Try your best - it is very important that you give the best answer possible.
|
|
421
|
-
|
|
422
|
-
<user_request>
|
|
423
|
-
{query}
|
|
424
|
-
</user_request>
|
|
425
|
-
|
|
426
|
-
The context to use to answer the query is shown below. If the context in not enough to satisfy the request,
|
|
427
|
-
you should ask the originator for more information. Include links to the source of the data.
|
|
428
|
-
|
|
429
|
-
<context>
|
|
430
|
-
{context}
|
|
431
|
-
</context>
|
|
432
|
-
"""
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
def format_examples_by_llm_type(examples: list, llm_type: str = "anthropic") -> list:
|
|
436
|
-
"""
|
|
437
|
-
Render examples based on llm type
|
|
438
|
-
|
|
439
|
-
Args:
|
|
440
|
-
llm_type (str): The type of LLM to render examples for (default: "anthropic")
|
|
441
|
-
examples (list): List of examples in model-agnostic format
|
|
442
|
-
|
|
443
|
-
Returns:
|
|
444
|
-
list: List of examples formatted for the specified LLM
|
|
445
|
-
"""
|
|
446
|
-
formatted_examples = []
|
|
447
|
-
|
|
448
|
-
if llm_type == "anthropic":
|
|
449
|
-
for example in examples:
|
|
450
|
-
formatted_example = format_example_for_anthropic(example)
|
|
451
|
-
formatted_examples.append(formatted_example)
|
|
452
|
-
else:
|
|
453
|
-
log.error(f"Unsupported LLM type: {llm_type}")
|
|
454
|
-
|
|
455
|
-
return formatted_examples
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
def format_example_for_anthropic(example: dict) -> str:
|
|
459
|
-
"""
|
|
460
|
-
Format an example for the Anthropic's LLMs
|
|
461
|
-
"""
|
|
462
|
-
|
|
463
|
-
tag_prefix = example.get("tag_prefix_placeholder", "t123")
|
|
464
|
-
starting_id = example.get("starting_id", "1")
|
|
465
|
-
docstring = example.get("docstring", "")
|
|
466
|
-
user_input = example.get("user_input", "")
|
|
467
|
-
metadata_lines = example.get("metadata", [])
|
|
468
|
-
reasoning_lines = example.get("reasoning", [])
|
|
469
|
-
response_text = example.get("response_text", "")
|
|
470
|
-
|
|
471
|
-
# Start building the XML structure, add the description and user input
|
|
472
|
-
xml_content = f"""<example>
|
|
473
|
-
<example_docstring>
|
|
474
|
-
{docstring}
|
|
475
|
-
</example_docstring>
|
|
476
|
-
<example_stimulus>
|
|
477
|
-
<{tag_prefix}stimulus starting_id="{starting_id}">
|
|
478
|
-
{user_input}
|
|
479
|
-
</{tag_prefix}stimulus>
|
|
480
|
-
<{tag_prefix}stimulus_metadata>
|
|
481
|
-
"""
|
|
482
|
-
|
|
483
|
-
# Add metadata lines
|
|
484
|
-
for metadata_line in metadata_lines:
|
|
485
|
-
xml_content += f"{metadata_line}\n"
|
|
486
|
-
|
|
487
|
-
xml_content += f"""</{tag_prefix}stimulus_metadata>
|
|
488
|
-
</example_stimulus>
|
|
489
|
-
<example_response>
|
|
490
|
-
<{tag_prefix}reasoning>
|
|
491
|
-
"""
|
|
492
|
-
|
|
493
|
-
# Add reasoning lines
|
|
494
|
-
for reasoning_line in reasoning_lines:
|
|
495
|
-
xml_content += f"{reasoning_line}\n"
|
|
496
|
-
|
|
497
|
-
xml_content += f"""</{tag_prefix}reasoning>
|
|
498
|
-
{response_text}"""
|
|
499
|
-
|
|
500
|
-
# Add action invocation section
|
|
501
|
-
if "action" in example:
|
|
502
|
-
action_data = example.get("action", {})
|
|
503
|
-
status_update = example.get("status_update", "")
|
|
504
|
-
agent_name = action_data.get("agent", "")
|
|
505
|
-
action_name = action_data.get("name", "")
|
|
506
|
-
|
|
507
|
-
xml_content += f"""
|
|
508
|
-
<{tag_prefix}status_update>{status_update}</{tag_prefix}status_update>
|
|
509
|
-
<{tag_prefix}invoke_action agent="{agent_name}" action="{action_name}">"""
|
|
510
|
-
|
|
511
|
-
# Handle parameters as dictionary
|
|
512
|
-
parameter_dict = action_data.get("parameters", {})
|
|
513
|
-
for param_name, param_value in parameter_dict.items():
|
|
514
|
-
xml_content += f"""
|
|
515
|
-
<{tag_prefix}parameter name="{param_name}">"""
|
|
516
|
-
|
|
517
|
-
# Handle parameter names and values (as lists)
|
|
518
|
-
if isinstance(param_value, list):
|
|
519
|
-
for line in param_value:
|
|
520
|
-
xml_content += f"\n{line}"
|
|
521
|
-
xml_content += "\n"
|
|
522
|
-
else:
|
|
523
|
-
# For simple string values
|
|
524
|
-
xml_content += f"{param_value}"
|
|
525
|
-
|
|
526
|
-
xml_content += f"</{tag_prefix}parameter>\n"
|
|
527
|
-
|
|
528
|
-
xml_content += f"</{tag_prefix}invoke_action>"
|
|
529
|
-
|
|
530
|
-
# Close the XML structure
|
|
531
|
-
xml_content += """
|
|
532
|
-
</example_response>
|
|
533
|
-
</example>
|
|
534
|
-
"""
|
|
535
|
-
|
|
536
|
-
return xml_content
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
LONG_TERM_MEMORY_PROMPT = " - You are capable of remembering things and have long-term memory, this happens automatically."
|
|
File without changes
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import List
|
|
3
|
-
|
|
4
|
-
from ....common.constants import DEFAULT_IDENTITY_KEY_FIELD
|
|
5
|
-
|
|
6
|
-
class BaseAuthorizationProvider(ABC):
|
|
7
|
-
PERMISSIVE_SCOPES = ["*:*:*"]
|
|
8
|
-
NO_SCOPES = []
|
|
9
|
-
|
|
10
|
-
def __init__(self, config: dict):
|
|
11
|
-
self.base_roles = config.get("base_roles", ["least_privileged_user"])
|
|
12
|
-
self.role_to_scope_mappings = config.get(
|
|
13
|
-
"role_to_scope_mappings",
|
|
14
|
-
{"least_privileged_user": BaseAuthorizationProvider.NO_SCOPES},
|
|
15
|
-
)
|
|
16
|
-
self.configuration = config.get("configuration", {})
|
|
17
|
-
self.authorization_field = config.get("key_field", DEFAULT_IDENTITY_KEY_FIELD)
|
|
18
|
-
|
|
19
|
-
@abstractmethod
|
|
20
|
-
def get_authorization_field(self) -> str:
|
|
21
|
-
"""Returns the configured field name to use for authorization lookup"""
|
|
22
|
-
pass
|
|
23
|
-
|
|
24
|
-
@abstractmethod
|
|
25
|
-
def get_scopes(self, identity: str) -> List[str]:
|
|
26
|
-
"""Get scopes for a given identity."""
|
|
27
|
-
pass
|
|
28
|
-
|
|
29
|
-
@abstractmethod
|
|
30
|
-
def get_roles(self, identity: str) -> List[str]:
|
|
31
|
-
"""Get roles for a given identity."""
|
|
32
|
-
pass
|
|
33
|
-
|
|
34
|
-
@staticmethod
|
|
35
|
-
def is_authorized(originator_scopes: List[str], agent_scopes: List[str]) -> bool:
|
|
36
|
-
"""Check if the originator's scopes authorize access to the agent's scopes."""
|
|
37
|
-
return any(
|
|
38
|
-
BaseAuthorizationProvider._scope_matches(originator_scope, agent_scope)
|
|
39
|
-
for originator_scope in originator_scopes
|
|
40
|
-
for agent_scope in agent_scopes
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
@staticmethod
|
|
44
|
-
def _scope_matches(originator_scope: str, agent_scope: str) -> bool:
|
|
45
|
-
if not isinstance(originator_scope, str) or not isinstance(agent_scope, str):
|
|
46
|
-
return False
|
|
47
|
-
if not originator_scope or not agent_scope:
|
|
48
|
-
return False
|
|
49
|
-
originator_parts = originator_scope.split(":")
|
|
50
|
-
agent_parts = agent_scope.split(":")
|
|
51
|
-
if len(originator_parts) != 3 or len(agent_parts) != 3:
|
|
52
|
-
return False
|
|
53
|
-
return all(
|
|
54
|
-
orig == agent or orig == "*" or agent == "*"
|
|
55
|
-
for orig, agent in zip(originator_parts, agent_parts)
|
|
56
|
-
)
|