massgen 0.1.0a3__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 massgen might be problematic. Click here for more details.

Files changed (111) hide show
  1. massgen/__init__.py +1 -1
  2. massgen/agent_config.py +17 -0
  3. massgen/api_params_handler/_api_params_handler_base.py +1 -0
  4. massgen/api_params_handler/_chat_completions_api_params_handler.py +8 -1
  5. massgen/api_params_handler/_claude_api_params_handler.py +8 -1
  6. massgen/api_params_handler/_gemini_api_params_handler.py +73 -0
  7. massgen/api_params_handler/_response_api_params_handler.py +8 -1
  8. massgen/backend/base.py +31 -0
  9. massgen/backend/{base_with_mcp.py → base_with_custom_tool_and_mcp.py} +282 -11
  10. massgen/backend/chat_completions.py +182 -92
  11. massgen/backend/claude.py +115 -18
  12. massgen/backend/claude_code.py +378 -14
  13. massgen/backend/docs/CLAUDE_API_RESEARCH.md +3 -3
  14. massgen/backend/gemini.py +1275 -1607
  15. massgen/backend/gemini_mcp_manager.py +545 -0
  16. massgen/backend/gemini_trackers.py +344 -0
  17. massgen/backend/gemini_utils.py +43 -0
  18. massgen/backend/response.py +129 -70
  19. massgen/cli.py +577 -110
  20. massgen/config_builder.py +376 -27
  21. massgen/configs/README.md +111 -80
  22. massgen/configs/basic/multi/three_agents_default.yaml +1 -1
  23. massgen/configs/basic/single/single_agent.yaml +1 -1
  24. massgen/configs/providers/openai/gpt5_nano.yaml +3 -3
  25. massgen/configs/tools/custom_tools/claude_code_custom_tool_example.yaml +32 -0
  26. massgen/configs/tools/custom_tools/claude_code_custom_tool_example_no_path.yaml +28 -0
  27. massgen/configs/tools/custom_tools/claude_code_custom_tool_with_mcp_example.yaml +40 -0
  28. massgen/configs/tools/custom_tools/claude_code_custom_tool_with_wrong_mcp_example.yaml +38 -0
  29. massgen/configs/tools/custom_tools/claude_code_wrong_custom_tool_with_mcp_example.yaml +38 -0
  30. massgen/configs/tools/custom_tools/claude_custom_tool_example.yaml +24 -0
  31. massgen/configs/tools/custom_tools/claude_custom_tool_example_no_path.yaml +22 -0
  32. massgen/configs/tools/custom_tools/claude_custom_tool_with_mcp_example.yaml +35 -0
  33. massgen/configs/tools/custom_tools/claude_custom_tool_with_wrong_mcp_example.yaml +33 -0
  34. massgen/configs/tools/custom_tools/claude_wrong_custom_tool_with_mcp_example.yaml +33 -0
  35. massgen/configs/tools/custom_tools/gemini_custom_tool_example.yaml +24 -0
  36. massgen/configs/tools/custom_tools/gemini_custom_tool_example_no_path.yaml +22 -0
  37. massgen/configs/tools/custom_tools/gemini_custom_tool_with_mcp_example.yaml +35 -0
  38. massgen/configs/tools/custom_tools/gemini_custom_tool_with_wrong_mcp_example.yaml +33 -0
  39. massgen/configs/tools/custom_tools/gemini_wrong_custom_tool_with_mcp_example.yaml +33 -0
  40. massgen/configs/tools/custom_tools/github_issue_market_analysis.yaml +94 -0
  41. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_example.yaml +24 -0
  42. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_example_no_path.yaml +22 -0
  43. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_mcp_example.yaml +35 -0
  44. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_wrong_mcp_example.yaml +33 -0
  45. massgen/configs/tools/custom_tools/gpt5_nano_wrong_custom_tool_with_mcp_example.yaml +33 -0
  46. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_example.yaml +25 -0
  47. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_example_no_path.yaml +23 -0
  48. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_mcp_example.yaml +34 -0
  49. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_wrong_mcp_example.yaml +34 -0
  50. massgen/configs/tools/custom_tools/gpt_oss_wrong_custom_tool_with_mcp_example.yaml +34 -0
  51. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_example.yaml +24 -0
  52. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_example_no_path.yaml +22 -0
  53. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_mcp_example.yaml +35 -0
  54. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_wrong_mcp_example.yaml +33 -0
  55. massgen/configs/tools/custom_tools/grok3_mini_wrong_custom_tool_with_mcp_example.yaml +33 -0
  56. massgen/configs/tools/custom_tools/qwen_api_custom_tool_example.yaml +25 -0
  57. massgen/configs/tools/custom_tools/qwen_api_custom_tool_example_no_path.yaml +23 -0
  58. massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_mcp_example.yaml +36 -0
  59. massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_wrong_mcp_example.yaml +34 -0
  60. massgen/configs/tools/custom_tools/qwen_api_wrong_custom_tool_with_mcp_example.yaml +34 -0
  61. massgen/configs/tools/custom_tools/qwen_local_custom_tool_example.yaml +24 -0
  62. massgen/configs/tools/custom_tools/qwen_local_custom_tool_example_no_path.yaml +22 -0
  63. massgen/configs/tools/custom_tools/qwen_local_custom_tool_with_mcp_example.yaml +35 -0
  64. massgen/configs/tools/custom_tools/qwen_local_custom_tool_with_wrong_mcp_example.yaml +33 -0
  65. massgen/configs/tools/custom_tools/qwen_local_wrong_custom_tool_with_mcp_example.yaml +33 -0
  66. massgen/configs/tools/filesystem/claude_code_context_sharing.yaml +1 -1
  67. massgen/configs/voting/gemini_gpt_voting_sensitivity.yaml +67 -0
  68. massgen/formatter/_chat_completions_formatter.py +104 -0
  69. massgen/formatter/_claude_formatter.py +120 -0
  70. massgen/formatter/_gemini_formatter.py +448 -0
  71. massgen/formatter/_response_formatter.py +88 -0
  72. massgen/frontend/coordination_ui.py +4 -2
  73. massgen/logger_config.py +35 -3
  74. massgen/message_templates.py +56 -6
  75. massgen/orchestrator.py +179 -10
  76. massgen/stream_chunk/base.py +3 -0
  77. massgen/tests/custom_tools_example.py +392 -0
  78. massgen/tests/mcp_test_server.py +17 -7
  79. massgen/tests/test_config_builder.py +423 -0
  80. massgen/tests/test_custom_tools.py +401 -0
  81. massgen/tests/test_tools.py +127 -0
  82. massgen/tool/README.md +935 -0
  83. massgen/tool/__init__.py +39 -0
  84. massgen/tool/_async_helpers.py +70 -0
  85. massgen/tool/_basic/__init__.py +8 -0
  86. massgen/tool/_basic/_two_num_tool.py +24 -0
  87. massgen/tool/_code_executors/__init__.py +10 -0
  88. massgen/tool/_code_executors/_python_executor.py +74 -0
  89. massgen/tool/_code_executors/_shell_executor.py +61 -0
  90. massgen/tool/_exceptions.py +39 -0
  91. massgen/tool/_file_handlers/__init__.py +10 -0
  92. massgen/tool/_file_handlers/_file_operations.py +218 -0
  93. massgen/tool/_manager.py +634 -0
  94. massgen/tool/_registered_tool.py +88 -0
  95. massgen/tool/_result.py +66 -0
  96. massgen/tool/_self_evolution/_github_issue_analyzer.py +369 -0
  97. massgen/tool/docs/builtin_tools.md +681 -0
  98. massgen/tool/docs/exceptions.md +794 -0
  99. massgen/tool/docs/execution_results.md +691 -0
  100. massgen/tool/docs/manager.md +887 -0
  101. massgen/tool/docs/workflow_toolkits.md +529 -0
  102. massgen/tool/workflow_toolkits/__init__.py +57 -0
  103. massgen/tool/workflow_toolkits/base.py +55 -0
  104. massgen/tool/workflow_toolkits/new_answer.py +126 -0
  105. massgen/tool/workflow_toolkits/vote.py +167 -0
  106. {massgen-0.1.0a3.dist-info → massgen-0.1.1.dist-info}/METADATA +89 -131
  107. {massgen-0.1.0a3.dist-info → massgen-0.1.1.dist-info}/RECORD +111 -36
  108. {massgen-0.1.0a3.dist-info → massgen-0.1.1.dist-info}/WHEEL +0 -0
  109. {massgen-0.1.0a3.dist-info → massgen-0.1.1.dist-info}/entry_points.txt +0 -0
  110. {massgen-0.1.0a3.dist-info → massgen-0.1.1.dist-info}/licenses/LICENSE +0 -0
  111. {massgen-0.1.0a3.dist-info → massgen-0.1.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,38 @@
1
+ # MassGen Configuration: Claude Code with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_code_wrong_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ orchestrator:
5
+ snapshot_storage: "claude_code_snapshots"
6
+ agent_temporary_workspace: "claude_code_temp"
7
+
8
+ agents:
9
+ - id: "claude_code_custom_tool" # Claude Code with wrong custom tool and MCP
10
+ backend:
11
+ type: "claude_code"
12
+ model: "claude-sonnet-4-20250514"
13
+ cwd: "claude_code_workspace"
14
+ custom_tools:
15
+ - name: ["two_num_tool"]
16
+ function: ["wrong_two_num_tool"]
17
+ mcp_servers:
18
+ - name: "weather"
19
+ type: "stdio"
20
+ command: "npx"
21
+ args: ["-y", "@fak111/weather-mcp"]
22
+ append_system_prompt: |
23
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
24
+
25
+ The two_num_tool is available as a custom tool that can add two numbers together.
26
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
27
+
28
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
29
+ a clear, accurate result.
30
+
31
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
32
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
33
+
34
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
35
+ response and provide concise, up-to-date information using the integrated tools.
36
+ ui:
37
+ display_type: "simple"
38
+ logging_enabled: true
@@ -0,0 +1,24 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_custom_tool_example "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "claude_custom_tool" # Anthropic Claude
6
+ backend:
7
+ type: "claude"
8
+ model: "claude-sonnet-4-20250514" # Model name
9
+ custom_tools:
10
+ - name: "two_num_tool"
11
+ category: "math"
12
+ path: "massgen/tool/_basic/_two_num_tool.py"
13
+ function: "two_num_tool"
14
+ system_message: |
15
+ You are an AI assistant with access to a custom math calculation tool.
16
+
17
+ The two_num_tool is available as a custom tool that can add two numbers together.
18
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
19
+
20
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
21
+ a clear, accurate result.
22
+ ui:
23
+ display_type: "simple"
24
+ logging_enabled: true
@@ -0,0 +1,22 @@
1
+ # MassGen Configuration: Claude with Custom Tool (No Path)
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_custom_tool_example_no_path "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "claude_custom_tool" # Anthropic Claude
6
+ backend:
7
+ type: "claude"
8
+ model: "claude-sonnet-4-20250514"
9
+ custom_tools:
10
+ - name: "two_num_tool"
11
+ function: "two_num_tool"
12
+ system_message: |
13
+ You are an AI assistant with access to a custom math calculation tool.
14
+
15
+ The two_num_tool is available as a custom tool that can add two numbers together.
16
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
17
+
18
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
19
+ a clear, accurate result.
20
+ ui:
21
+ display_type: "simple"
22
+ logging_enabled: true
@@ -0,0 +1,35 @@
1
+ # MassGen Configuration: Claude with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "claude_custom_tool" # Anthropic Claude
6
+ backend:
7
+ type: "claude"
8
+ model: "claude-sonnet-4-20250514"
9
+ custom_tools:
10
+ - name: "two_num_tool"
11
+ category: "math"
12
+ path: "massgen/tool/_basic/_two_num_tool.py"
13
+ function: "two_num_tool"
14
+ mcp_servers:
15
+ - name: "weather"
16
+ type: "stdio"
17
+ command: "npx"
18
+ args: ["-y", "@fak111/weather-mcp"]
19
+ system_message: |
20
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
21
+
22
+ The two_num_tool is available as a custom tool that can add two numbers together.
23
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
24
+
25
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
26
+ a clear, accurate result.
27
+
28
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
29
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
30
+
31
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
32
+ response and provide concise, up-to-date information using the integrated tools.
33
+ ui:
34
+ display_type: "simple"
35
+ logging_enabled: true
@@ -0,0 +1,33 @@
1
+ # MassGen Configuration: Claude with Wrong MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_custom_tool_with_wrong_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "claude_custom_tool" # Anthropic Claude
6
+ backend:
7
+ type: "claude"
8
+ model: "claude-sonnet-4-20250514"
9
+ custom_tools:
10
+ - name: "two_num_tool"
11
+ function: "two_num_tool"
12
+ mcp_servers:
13
+ - name: "weather"
14
+ type: "stdio"
15
+ command: "python"
16
+ args: ["-u", "-m", "aaa.bbb"] # Wrong MCP command to demonstrate error handling
17
+ system_message: |
18
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
19
+
20
+ The two_num_tool is available as a custom tool that can add two numbers together.
21
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
22
+
23
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
24
+ a clear, accurate result.
25
+
26
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
27
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
28
+
29
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
30
+ response and provide concise, up-to-date information using the integrated tools.
31
+ ui:
32
+ display_type: "simple"
33
+ logging_enabled: true
@@ -0,0 +1,33 @@
1
+ # MassGen Configuration: Claude with Wrong Custom Tool and MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_wrong_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "claude_custom_tool" # Anthropic Claude
6
+ backend:
7
+ type: "claude"
8
+ model: "claude-sonnet-4-20250514"
9
+ custom_tools:
10
+ - name: "two_num_tool"
11
+ function: "wrong_two_num_tool"
12
+ mcp_servers:
13
+ - name: "weather"
14
+ type: "stdio"
15
+ command: "npx"
16
+ args: ["-y", "@fak111/weather-mcp"]
17
+ system_message: |
18
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
19
+
20
+ The two_num_tool is available as a custom tool that can add two numbers together.
21
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
22
+
23
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
24
+ a clear, accurate result.
25
+
26
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
27
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
28
+
29
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
30
+ response and provide concise, up-to-date information using the integrated tools.
31
+ ui:
32
+ display_type: "simple"
33
+ logging_enabled: true
@@ -0,0 +1,24 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gemini_custom_tool_example "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "gemini2.5flash_custom_tool" # Google Gemini 2.5 Flash
6
+ backend:
7
+ type: "gemini"
8
+ model: "gemini-2.5-flash"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ category: "math"
12
+ path: "massgen/tool/_basic/_two_num_tool.py"
13
+ function: ["two_num_tool"]
14
+ system_message: |
15
+ You are an AI assistant with access to a custom math calculation tool.
16
+
17
+ The two_num_tool is available as a custom tool that can add two numbers together.
18
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
19
+
20
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
21
+ a clear, accurate result.
22
+ ui:
23
+ display_type: "rich_terminal"
24
+ logging_enabled: true
@@ -0,0 +1,22 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gemini_custom_tool_example_no_path "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "gemini2.5flash_custom_tool" # Google Gemini 2.5 Flash
6
+ backend:
7
+ type: "gemini"
8
+ model: "gemini-2.5-flash"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ function: ["two_num_tool"]
12
+ system_message: |
13
+ You are an AI assistant with access to a custom math calculation tool.
14
+
15
+ The two_num_tool is available as a custom tool that can add two numbers together.
16
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
17
+
18
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
19
+ a clear, accurate result.
20
+ ui:
21
+ display_type: "simple"
22
+ logging_enabled: true
@@ -0,0 +1,35 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gemini_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "gemini2.5flash_custom_tool" # Google Gemini 2.5 Flash
6
+ backend:
7
+ type: "gemini"
8
+ model: "gemini-2.5-flash"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ category: "math"
12
+ path: "massgen/tool/_basic/_two_num_tool.py"
13
+ function: ["two_num_tool"]
14
+ mcp_servers:
15
+ - name: "weather"
16
+ type: "stdio"
17
+ command: "npx"
18
+ args: ["-y", "@fak111/weather-mcp"]
19
+ system_message: |
20
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
21
+
22
+ The two_num_tool is available as a custom tool that can add two numbers together.
23
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
24
+
25
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
26
+ a clear, accurate result.
27
+
28
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
29
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
30
+
31
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
32
+ response and provide concise, up-to-date information using the integrated tools.
33
+ ui:
34
+ display_type: "simple"
35
+ logging_enabled: true
@@ -0,0 +1,33 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gemini_custom_tool_with_wrong_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "gemini2.5flash_custom_tool" # Google Gemini 2.5 Flash
6
+ backend:
7
+ type: "gemini"
8
+ model: "gemini-2.5-flash"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ function: ["two_num_tool"]
12
+ mcp_servers:
13
+ - name: "weather"
14
+ type: "stdio"
15
+ command: "python"
16
+ args: ["-u", "-m", "aaa.bbb"] # Wrong MCP command to demonstrate error handling
17
+ system_message: |
18
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
19
+
20
+ The two_num_tool is available as a custom tool that can add two numbers together.
21
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
22
+
23
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
24
+ a clear, accurate result.
25
+
26
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
27
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
28
+
29
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
30
+ response and provide concise, up-to-date information using the integrated tools.
31
+ ui:
32
+ display_type: "simple"
33
+ logging_enabled: true
@@ -0,0 +1,33 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gemini_wrong_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "gemini2.5flash_custom_tool" # Google Gemini 2.5 Flash
6
+ backend:
7
+ type: "gemini"
8
+ model: "gemini-2.5-flash"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ function: ["wrong_two_num_tool"]
12
+ mcp_servers:
13
+ - name: "weather"
14
+ type: "stdio"
15
+ command: "npx"
16
+ args: ["-y", "@fak111/weather-mcp"]
17
+ system_message: |
18
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
19
+
20
+ The two_num_tool is available as a custom tool that can add two numbers together.
21
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
22
+
23
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
24
+ a clear, accurate result.
25
+
26
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
27
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
28
+
29
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
30
+ response and provide concise, up-to-date information using the integrated tools.
31
+ ui:
32
+ display_type: "simple"
33
+ logging_enabled: true
@@ -0,0 +1,94 @@
1
+ # Example Configuration: GitHub Issue Market Analysis for Self-Evolution
2
+ #
3
+ # Use Case: Demonstrate Self-Evolution (Market Analysis) using custom tools
4
+ #
5
+ # This configuration showcases how MassGen agents can autonomously analyze
6
+ # GitHub issues AND broader market trends to prioritize features and drive
7
+ # market-driven development using access to the current MassGen code, custom tools + web search.
8
+ #
9
+ # Run with:
10
+ # uv run massgen --config massgen/configs/tools/custom_tools/github_issue_market_analysis.yaml "Analyze the massgen dir and MassGen GitHub issues to understand what features users are requesting. Also research current trends in multi-agent AI systems and LLM orchestration. Based on the existing code, the open issues and market trends, write a prioritized recommendation report for the next release."
11
+
12
+ agents:
13
+ - id: "agent_a"
14
+ backend:
15
+ type: "gemini"
16
+ model: "gemini-2.5-pro"
17
+ cwd: "workspace1"
18
+
19
+ # Custom GitHub issue analyzer tool
20
+ custom_tools:
21
+ - name: ["fetch_github_issues"]
22
+ category: "market_analysis"
23
+ path: "massgen/tool/_self_evolution/_github_issue_analyzer.py"
24
+ function: ["fetch_github_issues"]
25
+ description: ["Fetch and analyze GitHub issues for market-driven feature prioritization"]
26
+
27
+ # Enable web search for market research
28
+ enable_web_search: true
29
+
30
+ - id: "agent_b"
31
+ backend:
32
+ type: "openai"
33
+ model: "gpt-5-mini"
34
+ cwd: "workspace2"
35
+
36
+ text:
37
+ verbosity: "medium"
38
+ reasoning:
39
+ effort: "low"
40
+ summary: "auto"
41
+
42
+ # Same custom tool
43
+ custom_tools:
44
+ - name: ["fetch_github_issues"]
45
+ category: "market_analysis"
46
+ path: "massgen/tool/_self_evolution/_github_issue_analyzer.py"
47
+ function: ["fetch_github_issues"]
48
+
49
+ # Enable web search for market research
50
+ enable_web_search: true
51
+
52
+ # Orchestrator configuration
53
+ orchestrator:
54
+ snapshot_storage: "snapshots"
55
+ agent_temporary_workspace: "temp_workspaces"
56
+ context_paths:
57
+ - path: "massgen"
58
+ permission: "read"
59
+ # Adjust these settings to control collaboration behavior
60
+ # voting_sensitivity: Controls how critical agents are when voting
61
+ # - "lenient": Agents vote for answers more readily (default)
62
+ # - "balanced": Moderate voting threshold
63
+ # - "strict": Agents are more critical, vote only for excellent answers
64
+ voting_sensitivity: "balanced"
65
+
66
+ # answer_novelty_requirement: How different new answers must be
67
+ # - "lenient": Allow similar answers with minor variations (default)
68
+ # - "balanced": Require moderate differences
69
+ # - "strict": Require substantial novelty
70
+ answer_novelty_requirement: "lenient"
71
+
72
+ # max_new_answers_per_agent: Limit how many answers each agent can provide
73
+ # Uncomment to enable (useful for faster convergence)
74
+ max_new_answers_per_agent: 5
75
+
76
+ # coordination_config: Advanced coordination settings
77
+ # coordination_config:
78
+ # enable_planning_mode: false # If true, agents plan without executing during coordination
79
+
80
+ ui:
81
+ display_type: "rich_terminal"
82
+ logging_enabled: true
83
+
84
+ # What happens:
85
+ # 1. Both agents have access to:
86
+ # - Custom fetch_github_issues tool (analyzes user requests)
87
+ # - Web search (researches market trends and competitors)
88
+ # 2. User asks agents to combine GitHub issues + market research
89
+ # 3. Agents independently:
90
+ # - Fetch and analyze GitHub issues using custom tool
91
+ # - Research market trends using web search
92
+ # - Synthesize both sources into recommendations
93
+ # 4. Agents collaborate through voting to reach consensus
94
+ # 5. Final answer provides data-driven feature prioritization report
@@ -0,0 +1,24 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt5_nano_custom_tool_example "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "gpt5_nano_custom_tool" # OpenAI GPT-5 Nano
6
+ backend:
7
+ type: "openai"
8
+ model: "gpt-5-nano"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ category: "math"
12
+ path: "massgen/tool/_basic/_two_num_tool.py"
13
+ function: ["two_num_tool"]
14
+ system_message: |
15
+ You are an AI assistant with access to a custom math calculation tool.
16
+
17
+ The two_num_tool is available as a custom tool that can add two numbers together.
18
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
19
+
20
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
21
+ a clear, accurate result.
22
+ ui:
23
+ display_type: "simple"
24
+ logging_enabled: true
@@ -0,0 +1,22 @@
1
+ # MassGen Configuration: GPT-5 Nano with Custom Tool (No Path)
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt5_nano_custom_tool_example_no_path "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "gpt5_nano_custom_tool" # OpenAI GPT-5 Nano
6
+ backend:
7
+ type: "openai"
8
+ model: "gpt-5-nano"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ function: ["two_num_tool"]
12
+ system_message: |
13
+ You are an AI assistant with access to a custom math calculation tool.
14
+
15
+ The two_num_tool is available as a custom tool that can add two numbers together.
16
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
17
+
18
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
19
+ a clear, accurate result.
20
+ ui:
21
+ display_type: "simple"
22
+ logging_enabled: true
@@ -0,0 +1,35 @@
1
+ # MassGen Configuration: GPT-5 Nano with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt5_nano_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "gpt5_nano_custom_tool" # OpenAI GPT-5 Nano
6
+ backend:
7
+ type: "openai"
8
+ model: "gpt-5-nano"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ category: "math"
12
+ path: "massgen/tool/_basic/_two_num_tool.py"
13
+ function: ["two_num_tool"]
14
+ mcp_servers:
15
+ - name: "weather"
16
+ type: "stdio"
17
+ command: "npx"
18
+ args: ["-y", "@fak111/weather-mcp"]
19
+ system_message: |
20
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
21
+
22
+ The two_num_tool is available as a custom tool that can add two numbers together.
23
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
24
+
25
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
26
+ a clear, accurate result.
27
+
28
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
29
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
30
+
31
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
32
+ response and provide concise, up-to-date information using the integrated tools.
33
+ ui:
34
+ display_type: "simple"
35
+ logging_enabled: true
@@ -0,0 +1,33 @@
1
+ # MassGen Configuration: GPT-5 Nano with Wrong MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt5_nano_custom_tool_with_wrong_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "gpt5_nano_custom_tool" # OpenAI GPT-5 Nano
6
+ backend:
7
+ type: "openai"
8
+ model: "gpt-5-nano"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ function: ["two_num_tool"]
12
+ mcp_servers:
13
+ - name: "weather"
14
+ type: "stdio"
15
+ command: "python"
16
+ args: ["-u", "-m", "aaa.bbb"] # Wrong MCP command to demonstrate error handling
17
+ system_message: |
18
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
19
+
20
+ The two_num_tool is available as a custom tool that can add two numbers together.
21
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
22
+
23
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
24
+ a clear, accurate result.
25
+
26
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
27
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
28
+
29
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
30
+ response and provide concise, up-to-date information using the integrated tools.
31
+ ui:
32
+ display_type: "simple"
33
+ logging_enabled: true
@@ -0,0 +1,33 @@
1
+ # MassGen Configuration: GPT-5 Nano with Wrong Custom Tool and MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt5_nano_wrong_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ agents:
5
+ - id: "gpt5_nano_custom_tool" # OpenAI GPT-5 Nano
6
+ backend:
7
+ type: "openai"
8
+ model: "gpt-5-nano"
9
+ custom_tools:
10
+ - name: ["two_num_tool"]
11
+ function: ["wrong_two_num_tool"]
12
+ mcp_servers:
13
+ - name: "weather"
14
+ type: "stdio"
15
+ command: "npx"
16
+ args: ["-y", "@fak111/weather-mcp"]
17
+ system_message: |
18
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
19
+
20
+ The two_num_tool is available as a custom tool that can add two numbers together.
21
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
22
+
23
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
24
+ a clear, accurate result.
25
+
26
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
27
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
28
+
29
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
30
+ response and provide concise, up-to-date information using the integrated tools.
31
+ ui:
32
+ display_type: "simple"
33
+ logging_enabled: true
@@ -0,0 +1,25 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt_oss_custom_tool_example "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "gpt-oss-custom_tool" # Cerebras AI GPT-OSS
6
+ backend:
7
+ type: "chatcompletion"
8
+ model: "gpt-oss-120b"
9
+ base_url: "https://api.cerebras.ai/v1"
10
+ custom_tools:
11
+ - name: ["two_num_tool"]
12
+ category: "math"
13
+ path: "massgen/tool/_basic/_two_num_tool.py"
14
+ function: ["two_num_tool"]
15
+ system_message: |
16
+ You are an AI assistant with access to a custom math calculation tool.
17
+
18
+ The two_num_tool is available as a custom tool that can add two numbers together.
19
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
20
+
21
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
22
+ a clear, accurate result.
23
+ ui:
24
+ display_type: "simple"
25
+ logging_enabled: true
@@ -0,0 +1,23 @@
1
+ # MassGen Configuration: Gemini with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/gpt_oss_custom_tool_example_no_path "whats the sum of 123 and 456?"
4
+ agents:
5
+ - id: "gpt-oss-custom_tool" # Cerebras AI GPT-OSS
6
+ backend:
7
+ type: "chatcompletion"
8
+ model: "gpt-oss-120b"
9
+ base_url: "https://api.cerebras.ai/v1"
10
+ custom_tools:
11
+ - name: ["two_num_tool"]
12
+ function: ["two_num_tool"]
13
+ system_message: |
14
+ You are an AI assistant with access to a custom math calculation tool.
15
+
16
+ The two_num_tool is available as a custom tool that can add two numbers together.
17
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
18
+
19
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
20
+ a clear, accurate result.
21
+ ui:
22
+ display_type: "simple"
23
+ logging_enabled: true