solace-agent-mesh 0.0.1__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of solace-agent-mesh might be problematic. Click here for more details.

Files changed (176) hide show
  1. solace_agent_mesh/__init__.py +0 -3
  2. solace_agent_mesh/agents/__init__.py +0 -0
  3. solace_agent_mesh/agents/base_agent_component.py +224 -0
  4. solace_agent_mesh/agents/global/__init__.py +0 -0
  5. solace_agent_mesh/agents/global/actions/__init__.py +0 -0
  6. solace_agent_mesh/agents/global/actions/agent_state_change.py +54 -0
  7. solace_agent_mesh/agents/global/actions/clear_history.py +32 -0
  8. solace_agent_mesh/agents/global/actions/convert_file_to_markdown.py +160 -0
  9. solace_agent_mesh/agents/global/actions/create_file.py +70 -0
  10. solace_agent_mesh/agents/global/actions/error_action.py +45 -0
  11. solace_agent_mesh/agents/global/actions/plantuml_diagram.py +93 -0
  12. solace_agent_mesh/agents/global/actions/plotly_graph.py +117 -0
  13. solace_agent_mesh/agents/global/actions/retrieve_file.py +51 -0
  14. solace_agent_mesh/agents/global/global_agent_component.py +38 -0
  15. solace_agent_mesh/agents/image_processing/__init__.py +0 -0
  16. solace_agent_mesh/agents/image_processing/actions/__init__.py +0 -0
  17. solace_agent_mesh/agents/image_processing/actions/create_image.py +75 -0
  18. solace_agent_mesh/agents/image_processing/actions/describe_image.py +115 -0
  19. solace_agent_mesh/agents/image_processing/image_processing_agent_component.py +23 -0
  20. solace_agent_mesh/agents/slack/__init__.py +1 -0
  21. solace_agent_mesh/agents/slack/actions/__init__.py +1 -0
  22. solace_agent_mesh/agents/slack/actions/post_message.py +177 -0
  23. solace_agent_mesh/agents/slack/slack_agent_component.py +59 -0
  24. solace_agent_mesh/agents/web_request/__init__.py +0 -0
  25. solace_agent_mesh/agents/web_request/actions/__init__.py +0 -0
  26. solace_agent_mesh/agents/web_request/actions/do_image_search.py +84 -0
  27. solace_agent_mesh/agents/web_request/actions/do_news_search.py +47 -0
  28. solace_agent_mesh/agents/web_request/actions/do_suggestion_search.py +34 -0
  29. solace_agent_mesh/agents/web_request/actions/do_web_request.py +134 -0
  30. solace_agent_mesh/agents/web_request/actions/download_file.py +69 -0
  31. solace_agent_mesh/agents/web_request/web_request_agent_component.py +33 -0
  32. solace_agent_mesh/assets/web-visualizer/assets/index-C5awueeJ.js +109 -0
  33. solace_agent_mesh/assets/web-visualizer/assets/index-D0qORgkg.css +1 -0
  34. solace_agent_mesh/assets/web-visualizer/index.html +14 -0
  35. solace_agent_mesh/assets/web-visualizer/vite.svg +1 -0
  36. solace_agent_mesh/cli/__init__.py +1 -0
  37. solace_agent_mesh/cli/commands/__init__.py +0 -0
  38. solace_agent_mesh/cli/commands/add/__init__.py +3 -0
  39. solace_agent_mesh/cli/commands/add/add.py +88 -0
  40. solace_agent_mesh/cli/commands/add/agent.py +110 -0
  41. solace_agent_mesh/cli/commands/add/copy_from_plugin.py +90 -0
  42. solace_agent_mesh/cli/commands/add/gateway.py +221 -0
  43. solace_agent_mesh/cli/commands/build.py +631 -0
  44. solace_agent_mesh/cli/commands/chat/__init__.py +3 -0
  45. solace_agent_mesh/cli/commands/chat/chat.py +361 -0
  46. solace_agent_mesh/cli/commands/config.py +29 -0
  47. solace_agent_mesh/cli/commands/init/__init__.py +3 -0
  48. solace_agent_mesh/cli/commands/init/ai_provider_step.py +76 -0
  49. solace_agent_mesh/cli/commands/init/broker_step.py +102 -0
  50. solace_agent_mesh/cli/commands/init/builtin_agent_step.py +88 -0
  51. solace_agent_mesh/cli/commands/init/check_if_already_done.py +13 -0
  52. solace_agent_mesh/cli/commands/init/create_config_file_step.py +52 -0
  53. solace_agent_mesh/cli/commands/init/create_other_project_files_step.py +96 -0
  54. solace_agent_mesh/cli/commands/init/file_service_step.py +73 -0
  55. solace_agent_mesh/cli/commands/init/init.py +114 -0
  56. solace_agent_mesh/cli/commands/init/project_structure_step.py +45 -0
  57. solace_agent_mesh/cli/commands/init/rest_api_step.py +50 -0
  58. solace_agent_mesh/cli/commands/init/web_ui_step.py +40 -0
  59. solace_agent_mesh/cli/commands/plugin/__init__.py +3 -0
  60. solace_agent_mesh/cli/commands/plugin/add.py +98 -0
  61. solace_agent_mesh/cli/commands/plugin/build.py +217 -0
  62. solace_agent_mesh/cli/commands/plugin/create.py +117 -0
  63. solace_agent_mesh/cli/commands/plugin/plugin.py +109 -0
  64. solace_agent_mesh/cli/commands/plugin/remove.py +71 -0
  65. solace_agent_mesh/cli/commands/run.py +68 -0
  66. solace_agent_mesh/cli/commands/visualizer.py +138 -0
  67. solace_agent_mesh/cli/config.py +81 -0
  68. solace_agent_mesh/cli/main.py +306 -0
  69. solace_agent_mesh/cli/utils.py +246 -0
  70. solace_agent_mesh/common/__init__.py +0 -0
  71. solace_agent_mesh/common/action.py +91 -0
  72. solace_agent_mesh/common/action_list.py +37 -0
  73. solace_agent_mesh/common/action_response.py +327 -0
  74. solace_agent_mesh/common/constants.py +3 -0
  75. solace_agent_mesh/common/mysql_database.py +40 -0
  76. solace_agent_mesh/common/postgres_database.py +79 -0
  77. solace_agent_mesh/common/prompt_templates.py +30 -0
  78. solace_agent_mesh/common/prompt_templates_unused_delete.py +161 -0
  79. solace_agent_mesh/common/stimulus_utils.py +152 -0
  80. solace_agent_mesh/common/time.py +24 -0
  81. solace_agent_mesh/common/utils.py +638 -0
  82. solace_agent_mesh/configs/agent_global.yaml +74 -0
  83. solace_agent_mesh/configs/agent_image_processing.yaml +82 -0
  84. solace_agent_mesh/configs/agent_slack.yaml +64 -0
  85. solace_agent_mesh/configs/agent_web_request.yaml +75 -0
  86. solace_agent_mesh/configs/conversation_to_file.yaml +56 -0
  87. solace_agent_mesh/configs/error_catcher.yaml +56 -0
  88. solace_agent_mesh/configs/monitor.yaml +0 -0
  89. solace_agent_mesh/configs/monitor_stim_and_errors_to_slack.yaml +106 -0
  90. solace_agent_mesh/configs/monitor_user_feedback.yaml +58 -0
  91. solace_agent_mesh/configs/orchestrator.yaml +241 -0
  92. solace_agent_mesh/configs/service_embedding.yaml +81 -0
  93. solace_agent_mesh/configs/service_llm.yaml +265 -0
  94. solace_agent_mesh/configs/visualize_websocket.yaml +55 -0
  95. solace_agent_mesh/gateway/__init__.py +0 -0
  96. solace_agent_mesh/gateway/components/__init__.py +0 -0
  97. solace_agent_mesh/gateway/components/gateway_base.py +41 -0
  98. solace_agent_mesh/gateway/components/gateway_input.py +265 -0
  99. solace_agent_mesh/gateway/components/gateway_output.py +289 -0
  100. solace_agent_mesh/gateway/identity/bamboohr_identity.py +18 -0
  101. solace_agent_mesh/gateway/identity/identity_base.py +10 -0
  102. solace_agent_mesh/gateway/identity/identity_provider.py +60 -0
  103. solace_agent_mesh/gateway/identity/no_identity.py +9 -0
  104. solace_agent_mesh/gateway/identity/passthru_identity.py +9 -0
  105. solace_agent_mesh/monitors/base_monitor_component.py +26 -0
  106. solace_agent_mesh/monitors/feedback/user_feedback_monitor.py +75 -0
  107. solace_agent_mesh/monitors/stim_and_errors/stim_and_error_monitor.py +560 -0
  108. solace_agent_mesh/orchestrator/__init__.py +0 -0
  109. solace_agent_mesh/orchestrator/action_manager.py +225 -0
  110. solace_agent_mesh/orchestrator/components/__init__.py +0 -0
  111. solace_agent_mesh/orchestrator/components/orchestrator_action_manager_timeout_component.py +54 -0
  112. solace_agent_mesh/orchestrator/components/orchestrator_action_response_component.py +179 -0
  113. solace_agent_mesh/orchestrator/components/orchestrator_register_component.py +107 -0
  114. solace_agent_mesh/orchestrator/components/orchestrator_stimulus_processor_component.py +477 -0
  115. solace_agent_mesh/orchestrator/components/orchestrator_streaming_output_component.py +246 -0
  116. solace_agent_mesh/orchestrator/orchestrator_main.py +166 -0
  117. solace_agent_mesh/orchestrator/orchestrator_prompt.py +410 -0
  118. solace_agent_mesh/services/__init__.py +0 -0
  119. solace_agent_mesh/services/authorization/providers/base_authorization_provider.py +56 -0
  120. solace_agent_mesh/services/bamboo_hr_service/__init__.py +3 -0
  121. solace_agent_mesh/services/bamboo_hr_service/bamboo_hr.py +182 -0
  122. solace_agent_mesh/services/common/__init__.py +4 -0
  123. solace_agent_mesh/services/common/auto_expiry.py +45 -0
  124. solace_agent_mesh/services/common/singleton.py +18 -0
  125. solace_agent_mesh/services/file_service/__init__.py +14 -0
  126. solace_agent_mesh/services/file_service/file_manager/__init__.py +0 -0
  127. solace_agent_mesh/services/file_service/file_manager/bucket_file_manager.py +149 -0
  128. solace_agent_mesh/services/file_service/file_manager/file_manager_base.py +162 -0
  129. solace_agent_mesh/services/file_service/file_manager/memory_file_manager.py +64 -0
  130. solace_agent_mesh/services/file_service/file_manager/volume_file_manager.py +106 -0
  131. solace_agent_mesh/services/file_service/file_service.py +432 -0
  132. solace_agent_mesh/services/file_service/file_service_constants.py +54 -0
  133. solace_agent_mesh/services/file_service/file_transformations.py +131 -0
  134. solace_agent_mesh/services/file_service/file_utils.py +322 -0
  135. solace_agent_mesh/services/file_service/transformers/__init__.py +5 -0
  136. solace_agent_mesh/services/history_service/__init__.py +3 -0
  137. solace_agent_mesh/services/history_service/history_providers/__init__.py +0 -0
  138. solace_agent_mesh/services/history_service/history_providers/base_history_provider.py +78 -0
  139. solace_agent_mesh/services/history_service/history_providers/memory_history_provider.py +167 -0
  140. solace_agent_mesh/services/history_service/history_providers/redis_history_provider.py +163 -0
  141. solace_agent_mesh/services/history_service/history_service.py +139 -0
  142. solace_agent_mesh/services/llm_service/components/llm_request_component.py +293 -0
  143. solace_agent_mesh/services/llm_service/components/llm_service_component_base.py +152 -0
  144. solace_agent_mesh/services/middleware_service/__init__.py +0 -0
  145. solace_agent_mesh/services/middleware_service/middleware_service.py +20 -0
  146. solace_agent_mesh/templates/action.py +38 -0
  147. solace_agent_mesh/templates/agent.py +29 -0
  148. solace_agent_mesh/templates/agent.yaml +70 -0
  149. solace_agent_mesh/templates/gateway-config-template.yaml +6 -0
  150. solace_agent_mesh/templates/gateway-default-config.yaml +28 -0
  151. solace_agent_mesh/templates/gateway-flows.yaml +81 -0
  152. solace_agent_mesh/templates/gateway-header.yaml +16 -0
  153. solace_agent_mesh/templates/gateway_base.py +15 -0
  154. solace_agent_mesh/templates/gateway_input.py +98 -0
  155. solace_agent_mesh/templates/gateway_output.py +71 -0
  156. solace_agent_mesh/templates/plugin-pyproject.toml +30 -0
  157. solace_agent_mesh/templates/rest-api-default-config.yaml +24 -0
  158. solace_agent_mesh/templates/rest-api-flows.yaml +80 -0
  159. solace_agent_mesh/templates/slack-default-config.yaml +9 -0
  160. solace_agent_mesh/templates/slack-flows.yaml +90 -0
  161. solace_agent_mesh/templates/solace-agent-mesh-default.yaml +77 -0
  162. solace_agent_mesh/templates/solace-agent-mesh-plugin-default.yaml +8 -0
  163. solace_agent_mesh/templates/web-default-config.yaml +5 -0
  164. solace_agent_mesh/templates/web-flows.yaml +86 -0
  165. solace_agent_mesh/tools/__init__.py +0 -0
  166. solace_agent_mesh/tools/components/__init__.py +0 -0
  167. solace_agent_mesh/tools/components/conversation_formatter.py +111 -0
  168. solace_agent_mesh/tools/components/file_resolver_component.py +58 -0
  169. solace_agent_mesh/tools/config/runtime_config.py +26 -0
  170. solace_agent_mesh-0.1.1.dist-info/METADATA +179 -0
  171. solace_agent_mesh-0.1.1.dist-info/RECORD +174 -0
  172. solace_agent_mesh-0.1.1.dist-info/entry_points.txt +3 -0
  173. solace_agent_mesh-0.0.1.dist-info/licenses/LICENSE.txt → solace_agent_mesh-0.1.1.dist-info/licenses/LICENSE +1 -2
  174. solace_agent_mesh-0.0.1.dist-info/METADATA +0 -51
  175. solace_agent_mesh-0.0.1.dist-info/RECORD +0 -5
  176. {solace_agent_mesh-0.0.1.dist-info → solace_agent_mesh-0.1.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,24 @@
1
+
2
+ - rest_config: &rest_config
3
+ listen_port: ${REST_API_SERVER_INPUT_PORT}
4
+ endpoint: ${REST_API_SERVER_INPUT_ENDPOINT}
5
+ rate_limit: ${REST_API_SERVER_INPUT_RATE_LIMIT}
6
+ host: ${REST_API_SERVER_HOST}
7
+
8
+ - web_ui_config: &web_ui_config
9
+ enabled: ${WEBUI_ENABLED}
10
+ listen_port: ${WEBUI_PORT}
11
+ host: ${WEBUI_HOST}
12
+ response_api_url: ${WEBUI_RESPONSE_API_URL}
13
+ solace_broker_rest_messaging_url: ${SOLACE_BROKER_REST_MESSAGING_URL}
14
+ solace_agent_mesh_namespace: ${SOLACE_AGENT_MESH_NAMESPACE}
15
+ solace_broker_basic_auth: ${SOLACE_BROKER_BASIC_AUTH}
16
+ frontend_redirect_url: ${WEBUI_FRONTEND_REDIRECT_URL}
17
+ frontend_server_url: ${WEBUI_FRONTEND_SERVER_URL}
18
+ frontend_use_authorization: ${WEBUI_FRONTEND_USE_AUTHORIZATION}
19
+ frontend_auth_login_url: ${WEBUI_FRONTEND_AUTH_LOGIN_URL}
20
+ frontend_welcome_message: ${WEBUI_FRONTEND_WELCOME_MESSAGE}
21
+ frontend_bot_name: ${WEBUI_FRONTEND_BOT_NAME}
22
+ frontend_collect_feedback: ${WEBUI_FRONTEND_COLLECT_FEEDBACK}
23
+ frontend_url: ${WEBUI_FRONTEND_URL}
24
+ local_dev : ${WEBUI_LOCAL_DEV}
@@ -0,0 +1,80 @@
1
+
2
+ # Web UI
3
+ - name: web_ui
4
+ trace_level: ERROR
5
+ components:
6
+ - component_name: web_ui
7
+ component_module: solace_ai_connector_web.backend.server
8
+ component_config:
9
+ <<: *web_ui_config
10
+ # API to Gateway to Solace
11
+ - name: rest_gateway_input_flow
12
+ trace_level: ERROR
13
+ components:
14
+ - component_name: rest_input
15
+ component_module: solace_ai_connector_rest.components.rest_input
16
+ component_config:
17
+ <<: *rest_config
18
+ - component_name: gateway_input
19
+ component_base_path: .
20
+ component_module: src.gateway.components.gateway_input
21
+ component_config:
22
+ identity_key_field: user_email
23
+ <<: *gateway_config
24
+ component_input:
25
+ source_expression: previous
26
+ - component_name: broker_output
27
+ component_module: broker_output
28
+ component_config:
29
+ <<: *broker_connection
30
+ payload_encoding: utf-8
31
+ payload_format: json
32
+ copy_user_properties: true
33
+ input_transforms:
34
+ - type: copy
35
+ source_expression: previous
36
+ dest_expression: user_data.output:payload
37
+ - type: copy
38
+ source_expression: template:${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/stimulus/gateway/gateway_input/{{GATEWAY_ID}}
39
+ dest_expression: user_data.output:topic
40
+ component_input:
41
+ source_expression: user_data.output
42
+ # Solace to Gateway to Web
43
+ - name: rest_gateway_output_flow
44
+ trace_level: ERROR
45
+ components:
46
+ - component_name: broker_input
47
+ component_module: broker_input
48
+ component_config:
49
+ <<: *broker_connection
50
+ broker_queue_name: ${SOLACE_AGENT_MESH_NAMESPACE}_{{GATEWAY_ID}}
51
+ broker_subscriptions:
52
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/response/orchestrator/{{GATEWAY_ID}}
53
+ qos: 1
54
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/streamingResponse/orchestrator/{{GATEWAY_ID}}
55
+ qos: 1
56
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/responseComplete/orchestrator/{{GATEWAY_ID}}
57
+ qos: 1
58
+ payload_encoding: utf-8
59
+ payload_format: json
60
+ - component_name: gateway_output
61
+ component_base_path: .
62
+ component_module: src.gateway.components.gateway_output
63
+ component_config:
64
+ <<: *gateway_config
65
+ copy_user_properties: true
66
+ component_input:
67
+ source_expression: input.payload
68
+ - component_name: rest_output
69
+ component_module: solace_ai_connector_rest.components.rest_output
70
+ component_config:
71
+ <<: *rest_config
72
+ input_transforms:
73
+ - type: copy
74
+ source_expression: previous:payload
75
+ dest_expression: user_data.component_input:message_info
76
+ - type: copy
77
+ source_expression: input.payload
78
+ dest_expression: user_data.component_input:content
79
+ component_input:
80
+ source_expression: user_data.component_input
@@ -0,0 +1,9 @@
1
+ - slack_config: &slack_config
2
+ slack_bot_token: ${SLACK_BOT_TOKEN}
3
+ slack_app_token: ${SLACK_APP_TOKEN}
4
+ share_slack_connection: true
5
+ send_history_on_join: true
6
+ listen_to_channels: true
7
+ acknowledgement_message: "Chatbot is thinking... :hourglass_flowing_sand:"
8
+ max_total_file_size: 2000 # 2GB
9
+ max_file_size: 500 # 500MB
@@ -0,0 +1,90 @@
1
+
2
+ # Slack to Gateway to Solace
3
+ - name: slack_gateway_input_flow
4
+ components:
5
+ - component_name: slack_input
6
+ component_module: solace_ai_connector_slack.components.slack_input
7
+ component_package: solace_ai_connector_slack
8
+ component_config:
9
+ <<: *slack_config
10
+ - component_name: gateway_input
11
+ component_base_path: .
12
+ component_module: src.gateway.components.gateway_input
13
+ component_config:
14
+ identity_key_field: user_email
15
+ <<: *gateway_config
16
+ component_input:
17
+ source_expression: previous
18
+ input_transforms:
19
+ - type: copy
20
+ source_expression: input.payload:thread_id
21
+ dest_expression: input.user_properties:session_id
22
+ - type: copy
23
+ source_value: >
24
+ - Format the response as a Slack message, using appropriate
25
+ formatting such as *bold*, _italic_, and `code` where necessary.
26
+
27
+ - Use bullet points or numbered lists for multiple items.
28
+
29
+ - If including links, use the format <url|text>.
30
+ dest_expression: input.user_properties:response_format_prompt
31
+ - component_name: broker_output
32
+ component_module: broker_output
33
+ component_config:
34
+ <<: *broker_connection
35
+ payload_encoding: utf-8
36
+ payload_format: json
37
+ copy_user_properties: true
38
+ input_transforms:
39
+ - type: copy
40
+ source_expression: previous
41
+ dest_expression: user_data.output:payload
42
+ - type: copy
43
+ source_expression: template:${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/stimulus/gateway/gateway_input/{{GATEWAY_ID}}
44
+ dest_expression: user_data.output:topic
45
+ component_input:
46
+ source_expression: user_data.output
47
+
48
+ # Solace to Gateway to Slack
49
+ - name: slack_gateway_output_flow
50
+ trace_level: DEBUG
51
+ components:
52
+ - component_name: broker_input
53
+ component_module: broker_input
54
+ component_config:
55
+ <<: *broker_connection
56
+ broker_queue_name: ${SOLACE_AGENT_MESH_NAMESPACE}_{{GATEWAY_ID}}
57
+ broker_subscriptions:
58
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/response/orchestrator/{{GATEWAY_ID}}
59
+ qos: 1
60
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/streamingResponse/orchestrator/{{GATEWAY_ID}}
61
+ qos: 1
62
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/responseComplete/orchestrator/{{GATEWAY_ID}}
63
+ qos: 1
64
+ payload_encoding: utf-8
65
+ payload_format: json
66
+
67
+ - component_name: gateway_output
68
+ component_base_path: .
69
+ component_module: src.gateway.components.gateway_output
70
+ component_config:
71
+ <<: *gateway_config
72
+ copy_user_properties: true
73
+ component_input:
74
+ source_expression: input.payload
75
+
76
+ - component_name: slack_output
77
+ component_package: solace_ai_connector_slack
78
+ component_module: solace_ai_connector_slack.components.slack_output
79
+ component_config:
80
+ <<: *slack_config
81
+ input_transforms:
82
+ - type: copy
83
+ source_expression: input.user_properties
84
+ dest_expression: user_data.component_input:message_info
85
+ - type: copy
86
+ source_expression: input.payload
87
+ dest_expression: user_data.component_input:content
88
+ component_input:
89
+ source_expression: user_data.component_input
90
+
@@ -0,0 +1,77 @@
1
+ # mesh configuration
2
+ solace_agent_mesh:
3
+ # Built-in components (agents, gateways, etc)
4
+ built_in:
5
+ # Configuring the built-in agents
6
+ agents:
7
+ # Web request agent can make queries to web to get real-time data
8
+ - name: web_request
9
+ enabled: true
10
+ # Global agent
11
+ - name: global
12
+ enabled: true
13
+ # Generate images from text, or convert images to text
14
+ - name: image_processing
15
+ enabled: true
16
+ # Slack agent, send messages to Slack channels
17
+ - name: slack
18
+ enabled: true
19
+
20
+ # Directory to component yaml config files, this directory would have a sub directory for each component type
21
+ config_directory: configs
22
+ # Directory to python module files
23
+ modules_directory: src
24
+ # Directory to store yaml configs that will overwrite the default configs. Used for custom configurations
25
+ overwrite_directory: overwrite
26
+ # Env File path. If extract env is on, this file will be used to store the extracted env variables (Changes are appended, not overwritten)
27
+ env_file: .env
28
+
29
+ # Build configuration
30
+ build:
31
+ # Build directory for the generated files
32
+ build_directory: build
33
+ # Extract all environment variable names from all config files
34
+ extract_env_vars: true
35
+ # Logging configuration
36
+ log_level_override: INFO
37
+ # The number of instances of the orchestrator component to run in parallel
38
+ orchestrator_instance_count: 5
39
+
40
+ # Runtime configuration
41
+ runtime:
42
+ # Runtime Services
43
+ services:
44
+ # File service configuration
45
+ file_service:
46
+ # File service type: volume, bucket, memory, or your custom module name
47
+ type: volume
48
+ # Maximum time a file will be stored before being deleted in seconds
49
+ max_time_to_live: 86400 # 1 day
50
+ # Interval to check for expired files in seconds
51
+ expiration_check_interval: 600 # 10 minutes
52
+ # Type specific configuration
53
+ config:
54
+ # Volume configuration - Only needed if type is volume
55
+ volume:
56
+ directory: /tmp/solace-agent-mesh
57
+ # Bucket configuration - Only needed if type is bucket
58
+ bucket:
59
+ # Bucket name
60
+ bucket_name:
61
+ # AWS Endpoint URL - Optional
62
+ endpoint_url:
63
+ # AWS S3 configuration - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
64
+ # The following object is passed as kwargs to boto3.session.Session
65
+ boto3_config:
66
+ # AWS region name
67
+ region_name:
68
+ # AWS credentials
69
+ aws_access_key_id: # You can also use profiles instead, check boto3 documentation
70
+ aws_secret_access_key:
71
+ # If using a custom module, add a key here with your Module name (type)
72
+ # It must also have a module_path key with the path to the module
73
+ # For example, for type=MyCustomModule, you would add:
74
+ # MyCustomModule:
75
+ # module_path: path/to/module
76
+ # custom_key: value
77
+
@@ -0,0 +1,8 @@
1
+ # Solace Agent Mesh Plugin configuration
2
+ solace_agent_mesh_plugin:
3
+ # Plugin name
4
+ name: solace-agent-mesh-plugin
5
+
6
+ # Set to true if providing gateway interface under './interfaces' directory,
7
+ # each interface must have a 'interface-flows.yaml' and a 'interface-default-config.yaml' file
8
+ includes_gateway_interface: false
@@ -0,0 +1,5 @@
1
+ - web_config: &web_config
2
+ acknowledgement_message: "Chatbot is thinking... &#x23F3;"
3
+ max_total_file_size: 0.5
4
+ max_file_size: 2000 # 2GB
5
+
@@ -0,0 +1,86 @@
1
+ # Start the Web application
2
+ - name: start_web_app
3
+ trace_level: ERROR
4
+ components:
5
+ - component_name: start_web_app
6
+ component_package: solace_ai_connector_web
7
+ component_module: solace_ai_connector_web.components.start_web_app
8
+ # Web to Gateway to Solace
9
+ - name: web_gateway_input_flow
10
+ trace_level: ERROR
11
+ components:
12
+ - component_name: web_input
13
+ component_module: solace_ai_connector_web.components.web_input
14
+ component_package: solace_ai_connector_web
15
+ component_config:
16
+ <<: *web_config
17
+ - component_name: gateway_input
18
+ component_base_path: .
19
+ component_module: src.gateway.components.gateway_input
20
+ component_config:
21
+ identity_key_field: user_email
22
+ <<: *gateway_config
23
+ component_input:
24
+ source_expression: previous
25
+ input_transforms:
26
+ - type: copy
27
+ source_value: >
28
+ - Format the response as markdown.
29
+ dest_expression: input.user_properties:response_format_prompt
30
+ - component_name: broker_output
31
+ component_module: broker_output
32
+ component_config:
33
+ <<: *broker_connection
34
+ payload_encoding: utf-8
35
+ payload_format: json
36
+ copy_user_properties: true
37
+ input_transforms:
38
+ - type: copy
39
+ source_expression: previous
40
+ dest_expression: user_data.output:payload
41
+ - type: copy
42
+ source_expression: template:${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/stimulus/gateway/gateway_input/{{GATEWAY_ID}}
43
+ dest_expression: user_data.output:topic
44
+ component_input:
45
+ source_expression: user_data.output
46
+ # Solace to Gateway to Web
47
+ - name: web_gateway_output_flow
48
+ trace_level: ERROR
49
+ components:
50
+ - component_name: broker_input
51
+ component_module: broker_input
52
+ component_config:
53
+ <<: *broker_connection
54
+ broker_queue_name: ${SOLACE_AGENT_MESH_NAMESPACE}_{{GATEWAY_ID}}
55
+ broker_subscriptions:
56
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/response/orchestrator/{{GATEWAY_ID}}
57
+ qos: 1
58
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/streamingResponse/orchestrator/{{GATEWAY_ID}}
59
+ qos: 1
60
+ - topic: ${SOLACE_AGENT_MESH_NAMESPACE}solace-agent-mesh/v1/responseComplete/orchestrator/{{GATEWAY_ID}}
61
+ qos: 1
62
+ payload_encoding: utf-8
63
+ payload_format: json
64
+ - component_name: gateway_output
65
+ component_base_path: .
66
+ component_module: src.gateway.components.gateway_output
67
+ component_config:
68
+ <<: *gateway_config
69
+ copy_user_properties: true
70
+ component_input:
71
+ source_expression: input.payload
72
+ - component_name: web_output
73
+ component_package: solace_ai_connector_web
74
+ component_module: solace_ai_connector_web.components.web_output
75
+ component_config:
76
+ <<: *web_config
77
+ input_transforms:
78
+ - type: copy
79
+ source_expression: input.user_properties
80
+ dest_expression: user_data.component_input:message_info
81
+ - type: copy
82
+ source_expression: input.payload
83
+ dest_expression: user_data.component_input:content
84
+ component_input:
85
+ source_expression: user_data.component_input
86
+
File without changes
File without changes
@@ -0,0 +1,111 @@
1
+ """Reponsible for doing some formatting of the conversation"""
2
+
3
+ from solace_ai_connector.components.component_base import ComponentBase
4
+
5
+ info = {
6
+ "class_name": "ConversationFormatter",
7
+ "description": "Reponsible for doing some formatting of the conversation",
8
+ "config_parameters": [],
9
+ "input_schema": {
10
+ "type": "object",
11
+ "properties": {
12
+ "payload": {
13
+ "type": "object",
14
+ },
15
+ "topic": {
16
+ "type": "string",
17
+ },
18
+ "user_properties": {
19
+ "type": "object",
20
+ },
21
+ },
22
+ "required": ["payload", "topic", "user_properties"],
23
+ },
24
+ "output_schema": {
25
+ "type": "object",
26
+ "properties": {
27
+ "message": {
28
+ "type": "string",
29
+ },
30
+ },
31
+ },
32
+ }
33
+
34
+
35
+ class ConversationFormatter(ComponentBase):
36
+
37
+ def __init__(self, **kwargs):
38
+ super().__init__(info, **kwargs)
39
+
40
+ def invoke(self, message, data):
41
+ payload = data.get("payload")
42
+ topic = data.get("topic")
43
+ user_properties = data.get("user_properties")
44
+ output_message = None
45
+ if "/stimulus/gateway/" in topic:
46
+ # If the message is a stimulus, format the message to include the user's name
47
+ identity = user_properties.get("identity")
48
+ stimulus = payload.get("text")
49
+
50
+ if "/reinvoke" in topic:
51
+ output_message = f" Reinvoke the orchestrator with: \n{self.prefix_each_line(stimulus, ' ')}\n"
52
+ else:
53
+ output_message = f"\nNew request from {identity}:\n{self.prefix_each_line(stimulus, ' ')}\n"
54
+
55
+ if "/response/gateway/" in topic or "/streamingResponse/gateway/" in topic:
56
+ # If the payload contains last_chunk and it is not True, then skip this message
57
+ if not isinstance(payload, dict):
58
+ print("Payload is not a dictionary")
59
+ return {"message": None}
60
+ if payload.get("last_chunk") is not True:
61
+ output_message = None
62
+ else:
63
+ # If the message is a response, format the message to include the response
64
+ response = payload.get("text")
65
+ output_message = (
66
+ f" Response:\n{self.prefix_each_line(response, ' ')}\n"
67
+ )
68
+
69
+ if "/responseComplete/gateway/" in topic:
70
+ # If the message is a response complete, format the message to include the completion message
71
+ output_message = " Response complete\n"
72
+
73
+ if "/actionRequest/" in topic:
74
+ # If the message is an action request, format the message to include the action name
75
+ action_name = payload.get("action_name")
76
+ action_params = payload.get("action_params", {})
77
+
78
+ output_message = f" Action request: {action_name}\n"
79
+ # action params have the param name as the key and the value as the value
80
+ for param_name, param_value in action_params.items():
81
+ output_message += f" {param_name}: {self.prefix_each_line(param_value, ' ')}\n"
82
+
83
+ if "/actionResponse/" in topic:
84
+ # Get the two topic levels after .../agent/ to determine the agent name
85
+ after = topic.split("/agent/")[1]
86
+ topic_levels = after.split("/")
87
+ agent_name = topic_levels[0]
88
+ action_name = topic_levels[1]
89
+
90
+ output_message = f" Action response: {agent_name}.{action_name}\n"
91
+
92
+ for param, value in payload.items():
93
+ output_message += (
94
+ f" {param}: {self.prefix_each_line(value, ' ')}\n"
95
+ )
96
+
97
+ if output_message is None:
98
+ return {"message": None}
99
+
100
+ # Truncate the message if it is too long
101
+ if len(output_message) > 2000:
102
+ output_message = output_message[:2000] + "..."
103
+
104
+ # output_message += "\n"
105
+
106
+ return {"message": output_message}
107
+
108
+ def prefix_each_line(self, text, prefix):
109
+ if not isinstance(text, str):
110
+ return text
111
+ return "\n".join([f"{prefix}{line}" for line in text.split("\n")])
@@ -0,0 +1,58 @@
1
+ from typing import Dict, Any
2
+
3
+ from solace_ai_connector.components.component_base import ComponentBase
4
+ from solace_ai_connector.common.message import Message
5
+
6
+
7
+ from ...services.file_service import FileService, FS_PROTOCOL
8
+ from ...services.file_service.file_utils import recursive_file_resolver
9
+
10
+ info = {
11
+ "class_name": "FileResolverComponent",
12
+ "description": (
13
+ f"This component resolves all the {FS_PROTOCOL} URLs in the input data. "
14
+ "And returns the object with resolved URLs if `resolve_files` is set to True in user properties."
15
+ ),
16
+ "config_parameters": [
17
+ {
18
+ "name": "force_resolve",
19
+ "required": False,
20
+ "description": "Resolve all the urls regardless of the 'resolve' query parameter",
21
+ "default": True,
22
+ "type": "boolean",
23
+ },
24
+ ],
25
+ "input_schema": {
26
+ "type": "object", # Any Object or string
27
+ "required": [],
28
+ },
29
+ "output_schema": {
30
+ "type": "object", # Returns the object with resolved URLS
31
+ "required": [],
32
+ },
33
+ }
34
+
35
+
36
+ class FileResolverComponent(ComponentBase):
37
+ def __init__(self, **kwargs):
38
+ super().__init__(info, **kwargs)
39
+ self.file_service = FileService()
40
+ self.force_resolve = self.get_config("force_resolve", True)
41
+
42
+ def invoke(self, message: Message, data: Dict[str, Any]) -> Dict[str, Any]:
43
+ should_resolve_files = (message.get_user_properties() or {}).get("resolve_files", False)
44
+ if not should_resolve_files:
45
+ return data
46
+ copied_data = data.copy()
47
+ session_id = (message.get_user_properties() or {}).get("session_id")
48
+ if not session_id:
49
+ return copied_data
50
+
51
+ copied_data = recursive_file_resolver(
52
+ copied_data,
53
+ resolver=self.file_service.resolve_all_resolvable_urls,
54
+ session_id=session_id,
55
+ force_resolve=self.force_resolve,
56
+ )
57
+
58
+ return copied_data
@@ -0,0 +1,26 @@
1
+ import os
2
+ import yaml
3
+
4
+
5
+ def load_runtime_config(default_config_path=None):
6
+ config_path = (
7
+ default_config_path if default_config_path else os.getenv("RUNTIME_CONFIG_PATH")
8
+ )
9
+ if not config_path:
10
+ raise ValueError("Environment variable RUNTIME_CONFIG_PATH not set.")
11
+ config = {}
12
+ try:
13
+ with open(config_path, "r", encoding="utf-8") as yaml_str:
14
+ yaml_str = os.path.expandvars(yaml_str.read())
15
+ config = yaml.safe_load(yaml_str)
16
+ except FileNotFoundError as er:
17
+ raise FileNotFoundError(
18
+ f"Runtime config file not found at {config_path}"
19
+ ) from er
20
+ return config
21
+
22
+
23
+ def get_service_config(service_name, default_config_path=None):
24
+ config = load_runtime_config(default_config_path)
25
+ services = config.get("services", {})
26
+ return services.get(service_name, {})