massgen 0.1.0a3__py3-none-any.whl → 0.1.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 massgen might be problematic. Click here for more details.

Files changed (120) 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 +15 -2
  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 +83 -0
  9. massgen/backend/{base_with_mcp.py → base_with_custom_tool_and_mcp.py} +286 -15
  10. massgen/backend/capabilities.py +6 -6
  11. massgen/backend/chat_completions.py +200 -103
  12. massgen/backend/claude.py +115 -18
  13. massgen/backend/claude_code.py +378 -14
  14. massgen/backend/docs/CLAUDE_API_RESEARCH.md +3 -3
  15. massgen/backend/gemini.py +1333 -1629
  16. massgen/backend/gemini_mcp_manager.py +545 -0
  17. massgen/backend/gemini_trackers.py +344 -0
  18. massgen/backend/gemini_utils.py +43 -0
  19. massgen/backend/grok.py +39 -6
  20. massgen/backend/response.py +147 -81
  21. massgen/cli.py +605 -110
  22. massgen/config_builder.py +376 -27
  23. massgen/configs/README.md +123 -80
  24. massgen/configs/basic/multi/three_agents_default.yaml +3 -3
  25. massgen/configs/basic/single/single_agent.yaml +1 -1
  26. massgen/configs/providers/openai/gpt5_nano.yaml +3 -3
  27. massgen/configs/tools/custom_tools/claude_code_custom_tool_example.yaml +32 -0
  28. massgen/configs/tools/custom_tools/claude_code_custom_tool_example_no_path.yaml +28 -0
  29. massgen/configs/tools/custom_tools/claude_code_custom_tool_with_mcp_example.yaml +40 -0
  30. massgen/configs/tools/custom_tools/claude_code_custom_tool_with_wrong_mcp_example.yaml +38 -0
  31. massgen/configs/tools/custom_tools/claude_code_wrong_custom_tool_with_mcp_example.yaml +38 -0
  32. massgen/configs/tools/custom_tools/claude_custom_tool_example.yaml +24 -0
  33. massgen/configs/tools/custom_tools/claude_custom_tool_example_no_path.yaml +22 -0
  34. massgen/configs/tools/custom_tools/claude_custom_tool_with_mcp_example.yaml +35 -0
  35. massgen/configs/tools/custom_tools/claude_custom_tool_with_wrong_mcp_example.yaml +33 -0
  36. massgen/configs/tools/custom_tools/claude_wrong_custom_tool_with_mcp_example.yaml +33 -0
  37. massgen/configs/tools/custom_tools/gemini_custom_tool_example.yaml +24 -0
  38. massgen/configs/tools/custom_tools/gemini_custom_tool_example_no_path.yaml +22 -0
  39. massgen/configs/tools/custom_tools/gemini_custom_tool_with_mcp_example.yaml +35 -0
  40. massgen/configs/tools/custom_tools/gemini_custom_tool_with_wrong_mcp_example.yaml +33 -0
  41. massgen/configs/tools/custom_tools/gemini_wrong_custom_tool_with_mcp_example.yaml +33 -0
  42. massgen/configs/tools/custom_tools/github_issue_market_analysis.yaml +94 -0
  43. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_example.yaml +24 -0
  44. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_example_no_path.yaml +22 -0
  45. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_mcp_example.yaml +35 -0
  46. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_wrong_mcp_example.yaml +33 -0
  47. massgen/configs/tools/custom_tools/gpt5_nano_wrong_custom_tool_with_mcp_example.yaml +33 -0
  48. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_example.yaml +25 -0
  49. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_example_no_path.yaml +23 -0
  50. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_mcp_example.yaml +34 -0
  51. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_wrong_mcp_example.yaml +34 -0
  52. massgen/configs/tools/custom_tools/gpt_oss_wrong_custom_tool_with_mcp_example.yaml +34 -0
  53. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_example.yaml +24 -0
  54. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_example_no_path.yaml +22 -0
  55. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_mcp_example.yaml +35 -0
  56. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_wrong_mcp_example.yaml +33 -0
  57. massgen/configs/tools/custom_tools/grok3_mini_wrong_custom_tool_with_mcp_example.yaml +33 -0
  58. massgen/configs/tools/custom_tools/qwen_api_custom_tool_example.yaml +25 -0
  59. massgen/configs/tools/custom_tools/qwen_api_custom_tool_example_no_path.yaml +23 -0
  60. massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_mcp_example.yaml +36 -0
  61. massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_wrong_mcp_example.yaml +34 -0
  62. massgen/configs/tools/custom_tools/qwen_api_wrong_custom_tool_with_mcp_example.yaml +34 -0
  63. massgen/configs/tools/custom_tools/qwen_local_custom_tool_example.yaml +24 -0
  64. massgen/configs/tools/custom_tools/qwen_local_custom_tool_example_no_path.yaml +22 -0
  65. massgen/configs/tools/custom_tools/qwen_local_custom_tool_with_mcp_example.yaml +35 -0
  66. massgen/configs/tools/custom_tools/qwen_local_custom_tool_with_wrong_mcp_example.yaml +33 -0
  67. massgen/configs/tools/custom_tools/qwen_local_wrong_custom_tool_with_mcp_example.yaml +33 -0
  68. massgen/configs/tools/filesystem/claude_code_context_sharing.yaml +1 -1
  69. massgen/configs/tools/planning/five_agents_discord_mcp_planning_mode.yaml +7 -29
  70. massgen/configs/tools/planning/five_agents_filesystem_mcp_planning_mode.yaml +5 -6
  71. massgen/configs/tools/planning/five_agents_notion_mcp_planning_mode.yaml +4 -4
  72. massgen/configs/tools/planning/five_agents_twitter_mcp_planning_mode.yaml +4 -4
  73. massgen/configs/tools/planning/gpt5_mini_case_study_mcp_planning_mode.yaml +2 -2
  74. massgen/configs/voting/gemini_gpt_voting_sensitivity.yaml +67 -0
  75. massgen/formatter/_chat_completions_formatter.py +104 -0
  76. massgen/formatter/_claude_formatter.py +120 -0
  77. massgen/formatter/_gemini_formatter.py +448 -0
  78. massgen/formatter/_response_formatter.py +88 -0
  79. massgen/frontend/coordination_ui.py +4 -2
  80. massgen/logger_config.py +35 -3
  81. massgen/message_templates.py +56 -6
  82. massgen/orchestrator.py +512 -16
  83. massgen/stream_chunk/base.py +3 -0
  84. massgen/tests/custom_tools_example.py +392 -0
  85. massgen/tests/mcp_test_server.py +17 -7
  86. massgen/tests/test_config_builder.py +423 -0
  87. massgen/tests/test_custom_tools.py +401 -0
  88. massgen/tests/test_intelligent_planning_mode.py +643 -0
  89. massgen/tests/test_tools.py +127 -0
  90. massgen/token_manager/token_manager.py +13 -4
  91. massgen/tool/README.md +935 -0
  92. massgen/tool/__init__.py +39 -0
  93. massgen/tool/_async_helpers.py +70 -0
  94. massgen/tool/_basic/__init__.py +8 -0
  95. massgen/tool/_basic/_two_num_tool.py +24 -0
  96. massgen/tool/_code_executors/__init__.py +10 -0
  97. massgen/tool/_code_executors/_python_executor.py +74 -0
  98. massgen/tool/_code_executors/_shell_executor.py +61 -0
  99. massgen/tool/_exceptions.py +39 -0
  100. massgen/tool/_file_handlers/__init__.py +10 -0
  101. massgen/tool/_file_handlers/_file_operations.py +218 -0
  102. massgen/tool/_manager.py +634 -0
  103. massgen/tool/_registered_tool.py +88 -0
  104. massgen/tool/_result.py +66 -0
  105. massgen/tool/_self_evolution/_github_issue_analyzer.py +369 -0
  106. massgen/tool/docs/builtin_tools.md +681 -0
  107. massgen/tool/docs/exceptions.md +794 -0
  108. massgen/tool/docs/execution_results.md +691 -0
  109. massgen/tool/docs/manager.md +887 -0
  110. massgen/tool/docs/workflow_toolkits.md +529 -0
  111. massgen/tool/workflow_toolkits/__init__.py +57 -0
  112. massgen/tool/workflow_toolkits/base.py +55 -0
  113. massgen/tool/workflow_toolkits/new_answer.py +126 -0
  114. massgen/tool/workflow_toolkits/vote.py +167 -0
  115. {massgen-0.1.0a3.dist-info → massgen-0.1.2.dist-info}/METADATA +87 -129
  116. {massgen-0.1.0a3.dist-info → massgen-0.1.2.dist-info}/RECORD +120 -44
  117. {massgen-0.1.0a3.dist-info → massgen-0.1.2.dist-info}/WHEEL +0 -0
  118. {massgen-0.1.0a3.dist-info → massgen-0.1.2.dist-info}/entry_points.txt +0 -0
  119. {massgen-0.1.0a3.dist-info → massgen-0.1.2.dist-info}/licenses/LICENSE +0 -0
  120. {massgen-0.1.0a3.dist-info → massgen-0.1.2.dist-info}/top_level.txt +0 -0
massgen/configs/README.md CHANGED
@@ -48,7 +48,7 @@ massgen/configs/
48
48
  **Best starting point for multi-agent collaboration:**
49
49
  ```bash
50
50
  # Three powerful agents (Gemini, GPT-5, Grok) with enhanced workspace tools
51
- uv run python -m massgen.cli --config massgen/configs/basic/multi/three_agents_default.yaml "Your complex task"
51
+ massgen --config @examples/basic/multi/three_agents_default "Your complex task"
52
52
  ```
53
53
 
54
54
  This configuration combines:
@@ -61,25 +61,25 @@ This configuration combines:
61
61
  **Single agent with model name only:**
62
62
  ```bash
63
63
  # Quick test with any supported model - no configuration needed
64
- uv run python -m massgen.cli --model claude-3-5-sonnet-latest "What is machine learning?"
65
- uv run python -m massgen.cli --model gemini-2.5-flash "Explain quantum computing"
66
- uv run python -m massgen.cli --model gpt-5-nano "Summarize the latest AI developments"
64
+ massgen --model claude-3-5-sonnet-latest "What is machine learning?"
65
+ massgen --model gemini-2.5-flash "Explain quantum computing"
66
+ massgen --model gpt-5-nano "Summarize the latest AI developments"
67
67
  ```
68
68
 
69
69
  **Interactive Mode:**
70
70
  ```bash
71
71
  # Start interactive chat (no initial question)
72
- uv run python -m massgen.cli --config massgen/configs/basic/multi/three_agents_default.yaml
72
+ massgen --config @examples/basic/multi/three_agents_default
73
73
 
74
74
  # Debug mode for troubleshooting
75
- uv run python -m massgen.cli --config massgen/configs/basic/multi/three_agents_default.yaml --debug "Your question"
75
+ massgen --config @examples/basic/multi/three_agents_default --debug "Your question"
76
76
  ```
77
77
 
78
78
  ### Basic Usage
79
79
 
80
80
  For simple single-agent setups:
81
81
  ```bash
82
- uv run python -m massgen.cli --config massgen/configs/basic/single/single_agent.yaml "Your question"
82
+ massgen --config @examples/basic/single/single_agent "Your question"
83
83
  ```
84
84
 
85
85
  ### Tool-Enabled Configurations
@@ -88,32 +88,33 @@ uv run python -m massgen.cli --config massgen/configs/basic/single/single_agent.
88
88
  MCP enables agents to use external tools and services:
89
89
  ```bash
90
90
  # Weather queries
91
- uv run python -m massgen.cli --config massgen/configs/tools/mcp/gemini_mcp_example.yaml "What's the weather in Tokyo?"
91
+ massgen --config @examples/tools/mcp/gemini_mcp_example "What's the weather in Tokyo?"
92
92
 
93
93
  # Discord integration
94
- uv run python -m massgen.cli --config massgen/configs/tools/mcp/claude_code_discord_mcp_example.yaml "Extract latest messages"
94
+ massgen --config @examples/tools/mcp/claude_code_discord_mcp_example "Extract latest messages"
95
95
  ```
96
96
 
97
97
  #### Web Search
98
98
  For agents with web search capabilities:
99
99
  ```bash
100
- uv run python -m massgen.cli --config massgen/configs/tools/web-search/claude_streamable_http_test.yaml "Search for latest news"
100
+ massgen --config @examples/tools/web-search/claude_streamable_http_test "Search for latest news"
101
101
  ```
102
102
 
103
103
  #### Code Execution
104
104
  For code interpretation and execution:
105
105
  ```bash
106
- uv run python -m massgen.cli --config massgen/configs/tools/code-execution/multi_agent_playwright_automation.yaml "Browse three issues in https://github.com/Leezekun/MassGen and suggest documentation improvements. Include screenshots and suggestions in a website."
106
+ massgen --config @examples/tools/code-execution/multi_agent_playwright_automation \
107
+ "Browse three issues in https://github.com/Leezekun/MassGen and suggest documentation improvements. Include screenshots and suggestions in a website."
107
108
  ```
108
109
 
109
110
  #### Filesystem Operations
110
111
  For file manipulation, workspace management, and copy tools:
111
112
  ```bash
112
113
  # Single agent with enhanced file operations
113
- uv run python -m massgen.cli --config massgen/configs/tools/filesystem/claude_code_single.yaml "Analyze this codebase"
114
+ massgen --config @examples/tools/filesystem/claude_code_single "Analyze this codebase"
114
115
 
115
116
  # Multi-agent workspace collaboration with copy tools (NEW in v0.0.22)
116
- uv run python -m massgen.cli --config massgen/configs/tools/filesystem/claude_code_context_sharing.yaml "Create shared workspace files"
117
+ massgen --config @examples/tools/filesystem/claude_code_context_sharing "Create shared workspace files"
117
118
  ```
118
119
 
119
120
  ### Provider-Specific Examples
@@ -122,22 +123,22 @@ Each provider has unique features and capabilities:
122
123
 
123
124
  #### OpenAI (GPT-5 Series)
124
125
  ```bash
125
- uv run python -m massgen.cli --config massgen/configs/providers/openai/gpt5.yaml "Complex reasoning task"
126
+ massgen --config @examples/providers/openai/gpt5 "Complex reasoning task"
126
127
  ```
127
128
 
128
129
  #### Claude
129
130
  ```bash
130
- uv run python -m massgen.cli --config massgen/configs/providers/claude/claude_mcp_example.yaml "Creative writing task"
131
+ massgen --config @examples/providers/claude/claude_mcp_example "Creative writing task"
131
132
  ```
132
133
 
133
134
  #### Gemini
134
135
  ```bash
135
- uv run python -m massgen.cli --config massgen/configs/providers/gemini/gemini_mcp_example.yaml "Research task"
136
+ massgen --config @examples/providers/gemini/gemini_mcp_example "Research task"
136
137
  ```
137
138
 
138
139
  #### Local Models
139
140
  ```bash
140
- uv run python -m massgen.cli --config massgen/configs/providers/local/lmstudio.yaml "Run with local model"
141
+ massgen --config @examples/providers/local/lmstudio "Run with local model"
141
142
  ```
142
143
 
143
144
  ### Pre-Configured Teams
@@ -146,17 +147,17 @@ Teams are specialized multi-agent setups for specific domains:
146
147
 
147
148
  #### Creative Teams
148
149
  ```bash
149
- uv run python -m massgen.cli --config massgen/configs/teams/creative/creative_team.yaml "Write a story"
150
+ massgen --config @examples/teams/creative/creative_team "Write a story"
150
151
  ```
151
152
 
152
153
  #### Research Teams
153
154
  ```bash
154
- uv run python -m massgen.cli --config massgen/configs/teams/research/research_team.yaml "Analyze market trends"
155
+ massgen --config @examples/teams/research/research_team "Analyze market trends"
155
156
  ```
156
157
 
157
158
  #### Development Teams
158
159
  ```bash
159
- uv run python -m massgen.cli --config massgen/configs/teams/development/zai_coding_team.yaml "Build a web app"
160
+ massgen --config @examples/teams/development/zai_coding_team "Build a web app"
160
161
  ```
161
162
 
162
163
  ## Configuration File Format
@@ -219,14 +220,81 @@ backend:
219
220
 
220
221
  ## Environment Variables
221
222
 
222
- Most configurations use environment variables for API keys:
223
+ Most configurations use environment variables for API keys:so
223
224
  - Set up your `.env` file based on `.env.example`
224
225
  - Provider-specific keys: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.
225
226
  - MCP server keys: `DISCORD_BOT_TOKEN`, `BRAVE_API_KEY`, etc.
226
227
 
227
228
  ## Release History & Examples
228
229
 
229
- ### v0.0.32 - Latest
230
+ ### v0.1.2 - Latest
231
+ **New Features:** Intelligent Planning Mode, Claude 4.5 Haiku Support, Grok Web Search Improvements
232
+
233
+ **Configuration Files:**
234
+ - `massgen/configs/tools/planning/` - 5 planning mode configurations with selective blocking
235
+ - `massgen/configs/basic/multi/three_agents_default.yaml` - Updated with Grok-4-fast model
236
+
237
+ **Documentation:**
238
+ - `docs/case_studies/INTELLIGENT_PLANNING_MODE.md` - Complete intelligent planning mode guide
239
+
240
+ **Key Features:**
241
+ - **Intelligent Planning Mode**: Automatic analysis of question irreversibility for dynamic MCP tool blocking
242
+ - **Selective Tool Blocking**: Granular control over which MCP tools are blocked during planning
243
+ - **Enhanced Safety**: Read-only operations allowed, write operations blocked during coordination
244
+ - **Latest Models**: Claude 4.5 Haiku support with updated model priorities
245
+
246
+ **Try it:**
247
+ ```bash
248
+ # Install or upgrade
249
+ pip install --upgrade massgen
250
+
251
+ # Try intelligent planning mode with MCP tools
252
+ # (Please read the YAML file for required API keys: DISCORD_TOKEN, OPENAI_API_KEY, etc.)
253
+ massgen --config @examples/tools/planning/five_agents_discord_mcp_planning_mode \
254
+ "Check recent messages in our development channel, summarize the discussion, and post a helpful response about the current topic."
255
+
256
+ # Use latest Claude 4.5 Haiku model
257
+ # (Requires ANTHROPIC_API_KEY in .env)
258
+ massgen --model claude-haiku-4-5-20251001 \
259
+ "Summarize the latest AI developments"
260
+ ```
261
+
262
+ ### v0.1.1
263
+ **New Features:** Custom Tools System, Voting Sensitivity Controls, Interactive Configuration Builder
264
+
265
+ **Key Features:**
266
+ - Custom tools registration using `ToolManager` class
267
+ - Three-tier voting system (lenient/balanced/strict)
268
+ - 40+ custom tool examples
269
+ - Backend capabilities registry
270
+
271
+ **Try it:**
272
+ ```bash
273
+ # Try custom tools with agents
274
+ massgen --config @examples/tools/custom_tools/claude_custom_tool_example \
275
+ "whats the sum of 123 and 456?"
276
+
277
+ # Test voting sensitivity controls
278
+ massgen --config @examples/voting/gemini_gpt_voting_sensitivity \
279
+ "Your question here"
280
+ ```
281
+
282
+ ### v0.1.0
283
+ **New Features:** PyPI Package Release, Comprehensive Documentation, Interactive Setup Wizard, Enhanced CLI
284
+
285
+ **Key Features:**
286
+ - Official PyPI distribution: `pip install massgen` with global CLI command
287
+ - Interactive Setup Wizard with smart defaults for API keys and model selection
288
+ - Comprehensive documentation at [docs.massgen.ai](https://docs.massgen.ai/)
289
+ - Simplified command syntax: `massgen "question"` with `@examples/` prefix
290
+
291
+ **Try it:**
292
+ ```bash
293
+ pip install massgen && massgen
294
+ massgen --config @examples/basic/multi/three_agents_default "What is 2+2?"
295
+ ```
296
+
297
+ ### v0.0.32
230
298
  **New Features:** Docker Execution Mode, MCP Architecture Refactoring, Claude Code Docker Integration
231
299
 
232
300
  **Configuration Files:**
@@ -247,23 +315,19 @@ Most configurations use environment variables for API keys:
247
315
  **Try it:**
248
316
  ```bash
249
317
  # Docker isolated execution - secure command execution in containers
250
- uv run python -m massgen.cli \
251
- --config massgen/configs/tools/code-execution/docker_simple.yaml \
318
+ massgen --config @examples/tools/code-execution/docker_simple \
252
319
  "Write a factorial function and test it"
253
320
 
254
321
  # Multi-agent Docker deployment - each agent in isolated container
255
- uv run python -m massgen.cli \
256
- --config massgen/configs/tools/code-execution/docker_multi_agent.yaml \
322
+ massgen --config @examples/tools/code-execution/docker_multi_agent \
257
323
  "Build a Flask website about Bob Dylan"
258
324
 
259
325
  # Claude Code with Docker - automatic tool management
260
- uv run python -m massgen.cli \
261
- --config massgen/configs/tools/code-execution/docker_claude_code.yaml \
326
+ massgen --config @examples/tools/code-execution/docker_claude_code \
262
327
  "Build a Flask website about Bob Dylan"
263
328
 
264
329
  # Resource-limited Docker execution - production-ready setup
265
- uv run python -m massgen.cli \
266
- --config massgen/configs/tools/code-execution/docker_with_resource_limits.yaml \
330
+ massgen --config @examples/tools/code-execution/docker_with_resource_limits \
267
331
  "Fetch data from an API and analyze it"
268
332
  ```
269
333
 
@@ -281,9 +345,11 @@ uv run python -m massgen.cli \
281
345
  - `massgen/configs/basic/multi/gpt4o_audio_generation.yaml` - Multi-agent audio generation with GPT-4o
282
346
  - `massgen/configs/basic/single/single_gpt4o_video_generation.yaml` - Video generation with OpenAI Sora-2
283
347
 
348
+ **Case Study:**
349
+ - [Universal Code Execution via MCP](../../docs/case_studies/universal-code-execution-mcp.md)
350
+
284
351
  **Key Features:**
285
352
  - Universal `execute_command` tool works across Claude, Gemini, OpenAI (Response API), and Chat Completions providers (Grok, ZAI, etc.)
286
- - AG2 group chat integration with speaker selection modes (auto, round-robin, manual)
287
353
  - Audio tools: text-to-speech, audio transcription, audio generation
288
354
  - Video tools: text-to-video generation via Sora-2 API
289
355
  - Code execution in planning mode for safer coordination
@@ -292,28 +358,23 @@ uv run python -m massgen.cli \
292
358
  **Try it:**
293
359
  ```bash
294
360
  # Universal code execution - works with any backend
295
- uv run python -m massgen.cli \
296
- --config massgen/configs/tools/code-execution/basic_command_execution.yaml \
361
+ massgen --config @examples/tools/code-execution/basic_command_execution \
297
362
  "Write a Python function to calculate factorial and test it"
298
363
 
299
364
  # AG2 group chat - multi-agent conversations
300
- uv run python -m massgen.cli \
301
- --config massgen/configs/ag2/ag2_groupchat.yaml \
365
+ massgen --config @examples/ag2/ag2_groupchat \
302
366
  "Write a Python function to calculate factorial."
303
367
 
304
368
  # Mixed MassGen + AG2 agents - GPT-5-nano collaborating with AG2 team
305
- uv run python -m massgen.cli \
306
- --config massgen/configs/ag2/ag2_groupchat_gpt.yaml \
369
+ massgen --config @examples/ag2/ag2_groupchat_gpt \
307
370
  "Write a Python function to calculate factorial."
308
371
 
309
372
  # Audio generation
310
- uv run python -m massgen.cli \
311
- --config massgen/configs/basic/single/single_gpt4o_audio_generation.yaml \
373
+ massgen --config @examples/basic/single/single_gpt4o_audio_generation \
312
374
  "I want to you tell me a very short introduction about Sherlock Homes in one sentence, and I want you to use emotion voice to read it out loud."
313
375
 
314
376
  # Video generation with Sora-2
315
- uv run python -m massgen.cli \
316
- --config massgen/configs/basic/single/single_gpt4o_video_generation.yaml \
377
+ massgen --config @examples/basic/single/single_gpt4o_video_generation \
317
378
  "Generate a 4 seconds video with neon-lit alley at night, light rain, slow push-in, cinematic."
318
379
  ```
319
380
 
@@ -332,18 +393,15 @@ uv run python -m massgen.cli \
332
393
  **Try it:**
333
394
  ```bash
334
395
  # Audio understanding with OpenRouter
335
- uv run python -m massgen.cli \
336
- --config massgen/configs/basic/single/single_openrouter_audio_understanding.yaml \
396
+ massgen --config @examples/basic/single/single_openrouter_audio_understanding \
337
397
  "What is in this recording?"
338
398
 
339
399
  # Video understanding with Qwen API
340
- uv run python -m massgen.cli \
341
- --config massgen/configs/basic/single/single_qwen_video_understanding.yaml \
400
+ massgen --config @examples/basic/single/single_qwen_video_understanding \
342
401
  "Describe what happens in this video"
343
402
 
344
403
  # Multi-agent filesystem collaboration
345
- uv run python -m massgen.cli \
346
- --config massgen/configs/tools/filesystem/cc_gpt5_gemini_filesystem.yaml \
404
+ massgen --config @examples/tools/filesystem/cc_gpt5_gemini_filesystem \
347
405
  "Create a comprehensive project with documentation"
348
406
  ```
349
407
 
@@ -366,18 +424,15 @@ uv run python -m massgen.cli \
366
424
  **Try it:**
367
425
  ```bash
368
426
  # Planning mode with filesystem operations
369
- uv run python -m massgen.cli \
370
- --config massgen/configs/tools/planning/five_agents_filesystem_mcp_planning_mode.yaml \
427
+ massgen --config @examples/tools/planning/five_agents_filesystem_mcp_planning_mode \
371
428
  "Create a comprehensive project structure with documentation"
372
429
 
373
430
  # Multi-agent weather MCP testing
374
- uv run python -m massgen.cli \
375
- --config massgen/configs/tools/mcp/five_agents_weather_mcp_test.yaml \
431
+ massgen --config @examples/tools/mcp/five_agents_weather_mcp_test \
376
432
  "Compare weather forecasts for New York, London, and Tokyo"
377
433
 
378
434
  # Planning mode with Twitter integration
379
- uv run python -m massgen.cli \
380
- --config massgen/configs/tools/planning/five_agents_twitter_mcp_planning_mode.yaml \
435
+ massgen --config @examples/tools/planning/five_agents_twitter_mcp_planning_mode \
381
436
  "Draft and plan tweet series about AI advancements"
382
437
  ```
383
438
 
@@ -396,19 +451,16 @@ uv run python -m massgen.cli \
396
451
  **Try it:**
397
452
  ```bash
398
453
  # AG2 single agent with code execution
399
- uv run python -m massgen.cli \
400
- --config massgen/configs/ag2/ag2_coder.yaml \
454
+ massgen --config @examples/ag2/ag2_coder \
401
455
  "Create a factorial function and calculate the factorial of 8. Show the result?"
402
456
 
403
457
  # Mixed team: AG2 agent + Gemini agent
404
- uv run python -m massgen.cli \
405
- --config massgen/configs/ag2/ag2_gemini.yaml \
458
+ massgen --config @examples/ag2/ag2_gemini \
406
459
  "what is quantum computing?"
407
460
 
408
461
  # AG2 case study: Compare AG2 and MassGen (requires external dependency)
409
462
  uv pip install -e ".[external]"
410
- uv run python -m massgen.cli \
411
- --config massgen/configs/ag2/ag2_coder_case_study.yaml \
463
+ massgen --config @examples/ag2/ag2_coder_case_study \
412
464
  "Output a summary comparing the differences between AG2 (https://github.com/ag2ai/ag2) and MassGen (https://github.com/Leezekun/MassGen) for LLM agents."
413
465
  ```
414
466
 
@@ -425,18 +477,15 @@ uv run python -m massgen.cli \
425
477
  **Try it:**
426
478
  ```bash
427
479
  # Image generation with single agent
428
- uv run python -m massgen.cli \
429
- --config massgen/configs/basic/single/single_gpt4o_image_generation.yaml \
480
+ massgen --config @examples/basic/single/single_gpt4o_image_generation \
430
481
  "Generate an image of gray tabby cat hugging an otter with an orange scarf. Limit image size within 5kb."
431
482
 
432
483
  # Image understanding with multiple agents
433
- uv run python -m massgen.cli \
434
- --config massgen/configs/basic/multi/gpt5nano_image_understanding.yaml \
484
+ massgen --config @examples/basic/multi/gpt5nano_image_understanding \
435
485
  "Please summarize the content in this image."
436
486
 
437
487
  # File search for document Q&A
438
- uv run python -m massgen.cli \
439
- --config massgen/configs/basic/single/single_gpt5nano_file_search.yaml \
488
+ massgen --config @examples/basic/single/single_gpt5nano_file_search \
440
489
  "What is humanity's last exam score for OpenAI Deep Research? Also, provide details about the other models mentioned in the PDF?"
441
490
  ```
442
491
 
@@ -450,13 +499,11 @@ uv run python -m massgen.cli \
450
499
  **Try it:**
451
500
  ```bash
452
501
  # Protected paths - keep reference files safe
453
- uv run python -m massgen.cli \
454
- --config massgen/configs/tools/filesystem/gemini_gpt5nano_protected_paths.yaml \
502
+ massgen --config @examples/tools/filesystem/gemini_gpt5nano_protected_paths \
455
503
  "Review the HTML and CSS files, then improve the styling"
456
504
 
457
505
  # File-based context paths - grant access to specific files
458
- uv run python -m massgen.cli \
459
- --config massgen/configs/tools/filesystem/gemini_gpt5nano_file_context_path.yaml \
506
+ massgen --config @examples/tools/filesystem/gemini_gpt5nano_file_context_path \
460
507
  "Analyze the CSS file and make modern improvements"
461
508
  ```
462
509
 
@@ -491,8 +538,7 @@ Turn 2: Can you (1) remove the image placeholder? we will not use image directly
491
538
  ```bash
492
539
  # Try vLLM backend with local models (requires vLLM server running)
493
540
  # First start vLLM server: python -m vllm.entrypoints.openai.api_server --model Qwen/Qwen3-0.6B --host 0.0.0.0 --port 8000
494
- uv run python -m massgen.cli \
495
- --config massgen/configs/basic/multi/two_qwen_vllm.yaml \
541
+ massgen --config @examples/basic/multi/two_qwen_vllm \
496
542
  "What is machine learning?"
497
543
  ```
498
544
 
@@ -510,7 +556,7 @@ uv run python -m massgen.cli \
510
556
  **Case Study:** [Advanced Filesystem with User Context Path Support](../../docs/case_studies/v0.0.21-v0.0.22-filesystem-permissions.md)
511
557
  ```bash
512
558
  # Multi-agent collaboration with granular filesystem permissions
513
- uv run python -m massgen.cli --config massgen/configs/tools/filesystem/gpt5mini_cc_fs_context_path.yaml "Enhance the website in massgen/configs/resources with: 1) A dark/light theme toggle with smooth transitions, 2) An interactive feature that helps users engage with the blog content (your choice - could be search, filtering by topic, reading time estimates, social sharing, reactions, etc.), and 3) Visual polish with CSS animations or transitions that make the site feel more modern and responsive. Use vanilla JavaScript and be creative with the implementation details."
559
+ massgen --config @examples/tools/filesystem/gpt5mini_cc_fs_context_path "Enhance the website in massgen/configs/resources with: 1) A dark/light theme toggle with smooth transitions, 2) An interactive feature that helps users engage with the blog content (your choice - could be search, filtering by topic, reading time estimates, social sharing, reactions, etc.), and 3) Visual polish with CSS animations or transitions that make the site feel more modern and responsive. Use vanilla JavaScript and be creative with the implementation details."
514
560
  ```
515
561
 
516
562
  ### v0.0.21
@@ -522,8 +568,7 @@ uv run python -m massgen.cli --config massgen/configs/tools/filesystem/gpt5mini_
522
568
  **Try it:**
523
569
  ```bash
524
570
  # Grok with MCP tools
525
- uv run python -m massgen.cli \
526
- --config massgen/configs/tools/mcp/grok3_mini_mcp_example.yaml \
571
+ massgen --config @examples/tools/mcp/grok3_mini_mcp_example \
527
572
  "What's the weather in Tokyo?"
528
573
  ```
529
574
 
@@ -535,8 +580,7 @@ uv run python -m massgen.cli \
535
580
  **Try it:**
536
581
  ```bash
537
582
  # Claude with MCP tools
538
- uv run python -m massgen.cli \
539
- --config massgen/configs/tools/mcp/claude_mcp_example.yaml \
583
+ massgen --config @examples/tools/mcp/claude_mcp_example \
540
584
  "What's the current weather?"
541
585
  ```
542
586
 
@@ -548,8 +592,7 @@ uv run python -m massgen.cli \
548
592
  **Try it:**
549
593
  ```bash
550
594
  # Claude with MCP tools
551
- uv run python -m massgen.cli \
552
- --config massgen/configs/tools/mcp/gpt5_nano_mcp_example.yaml \
595
+ massgen --config @examples/tools/mcp/gpt5_nano_mcp_example \
553
596
  "whats the weather of Tokyo?"
554
597
  ```
555
598
 
@@ -559,7 +602,7 @@ uv run python -m massgen.cli \
559
602
  **Case Study:** [Cross-Backend Collaboration with Gemini MCP Filesystem](../../docs/case_studies/unified-filesystem-mcp-integration.md)
560
603
  ```bash
561
604
  # Gemini and Claude Code agents with unified filesystem via MCP
562
- uv run python -m massgen.cli --config massgen/configs/tools/mcp/gemini_mcp_filesystem_test_with_claude_code.yaml "Create a presentation that teaches a reinforcement learning algorithm and output it in LaTeX Beamer format. No figures should be added."
605
+ massgen --config @examples/tools/mcp/gemini_mcp_filesystem_test_with_claude_code "Create a presentation that teaches a reinforcement learning algorithm and output it in LaTeX Beamer format. No figures should be added."
563
606
  ```
564
607
 
565
608
  ### v0.0.15
@@ -572,7 +615,7 @@ uv run python -m massgen.cli --config massgen/configs/tools/mcp/gemini_mcp_files
572
615
  **Case Study:** [Claude Code Workspace Management with Comprehensive Logging](../../docs/case_studies/claude-code-workspace-management.md)
573
616
  ```bash
574
617
  # Multi-agent Claude Code collaboration with enhanced workspace isolation
575
- uv run python -m massgen.cli --config massgen/configs/tools/filesystem/claude_code_context_sharing.yaml "Create a website about a diverse set of fun facts about LLMs, placing the output in one index.html file"
618
+ massgen --config @examples/tools/filesystem/claude_code_context_sharing "Create a website about a diverse set of fun facts about LLMs, placing the output in one index.html file"
576
619
  ```
577
620
 
578
621
  ### v0.0.10
@@ -1,6 +1,6 @@
1
1
  # MassGen Three Agent Configuration
2
2
  # Gemini-2.5-flash, GPT-5-nano, and Grok-3-mini with builtin tools enabled
3
-
3
+ # uv run python -m massgen.cli --config massgen/configs/basic/multi/three_agents_default.yaml "What is 2+2?"
4
4
  agents:
5
5
  - id: "gemini2.5flash"
6
6
  backend:
@@ -17,7 +17,7 @@ agents:
17
17
  text:
18
18
  verbosity: "medium"
19
19
  reasoning:
20
- effort: "medium"
20
+ effort: "low"
21
21
  summary: "auto"
22
22
  enable_web_search: true
23
23
  enable_code_interpreter: true
@@ -26,7 +26,7 @@ agents:
26
26
  - id: "grok3mini"
27
27
  backend:
28
28
  type: "grok"
29
- model: "grok-3-mini"
29
+ model: "grok-4-fast"
30
30
  enable_web_search: true
31
31
  # system_message: "You are a helpful AI assistant with web search capabilities. For any question involving current events, recent information, or real-time data, ALWAYS use web search first."
32
32
 
@@ -1,5 +1,5 @@
1
1
  # Example Gemini configuration for MassGen
2
- # Usage: uv run python -m massgen.cli --config example_gemini_config.yaml "Your question here"
2
+ # Usage: uv run python -m massgen.cli --config massgen/configs/basic/single/single_agent.yaml "What is 2+2?"
3
3
 
4
4
  # Single agent configuration
5
5
  agent:
@@ -6,7 +6,7 @@ agents:
6
6
  backend:
7
7
  type: "openai"
8
8
  model: "gpt-5-nano"
9
- text:
9
+ text:
10
10
  verbosity: "medium"
11
11
  reasoning:
12
12
  effort: "low"
@@ -19,7 +19,7 @@ agents:
19
19
  backend:
20
20
  type: "openai"
21
21
  model: "gpt-5-nano"
22
- text:
22
+ text:
23
23
  verbosity: "medium"
24
24
  reasoning:
25
25
  effort: "medium"
@@ -32,7 +32,7 @@ agents:
32
32
  backend:
33
33
  type: "openai"
34
34
  model: "gpt-5-nano"
35
- text:
35
+ text:
36
36
  verbosity: "medium"
37
37
  reasoning:
38
38
  effort: "high"
@@ -0,0 +1,32 @@
1
+ # MassGen Configuration: Claude Code with Custom Tools
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_code_custom_tool_example "whats the sum of 123 and 456?"
4
+
5
+ orchestrator:
6
+ snapshot_storage: "claude_code_snapshots"
7
+ agent_temporary_workspace: "claude_code_temp"
8
+
9
+ agents:
10
+ - id: "claude_code_custom_tools"
11
+ backend:
12
+ type: "claude_code"
13
+ model: "claude-sonnet-4-20250514"
14
+ cwd: "claude_code_workspace"
15
+ custom_tools:
16
+ - name: ["two_num_tool"]
17
+ category: "math"
18
+ path: "massgen/tool/_basic/_two_num_tool.py"
19
+ function: ["two_num_tool"]
20
+ description: ["Add two numbers together"]
21
+ append_system_prompt: |
22
+ You are an AI assistant with access to custom calculation tools in addition to your built-in Claude Code tools.
23
+
24
+ When users ask about calculations or math operations, check if a custom tool is available and use it.
25
+ The custom tools will be described in your system prompt, and you should call them using the JSON format specified.
26
+
27
+ Remember to use your built-in tools (Read, Write, Bash, etc.) for file operations and system tasks,
28
+ but use custom tools for specialized calculations when appropriate.
29
+
30
+ ui:
31
+ display_type: "simple"
32
+ logging_enabled: true
@@ -0,0 +1,28 @@
1
+ # MassGen Configuration: Claude Code with Custom Tools Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_code_custom_tool_example_no_path "whats the sum of 123 and 456?"
4
+
5
+ orchestrator:
6
+ snapshot_storage: "claude_code_snapshots"
7
+ agent_temporary_workspace: "claude_code_temp"
8
+
9
+ agents:
10
+ - id: "claude_code_custom_tool" # Claude Code with custom tools
11
+ backend:
12
+ type: "claude_code"
13
+ model: "claude-sonnet-4-20250514"
14
+ cwd: "claude_code_workspace"
15
+ custom_tools:
16
+ - name: ["two_num_tool"]
17
+ function: ["two_num_tool"]
18
+ append_system_prompt: |
19
+ You are an AI assistant with access to a custom math calculation tool.
20
+
21
+ The two_num_tool is available as a custom tool that can add two numbers together.
22
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
23
+
24
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
25
+ a clear, accurate result.
26
+ ui:
27
+ display_type: "simple"
28
+ logging_enabled: true
@@ -0,0 +1,40 @@
1
+ # MassGen Configuration: Claude Code with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_code_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 custom tools 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
+ category: "math"
17
+ path: "massgen/tool/_basic/_two_num_tool.py"
18
+ function: ["two_num_tool"]
19
+ mcp_servers:
20
+ - name: "weather"
21
+ type: "stdio"
22
+ command: "npx"
23
+ args: ["-y", "@fak111/weather-mcp"]
24
+ append_system_prompt: |
25
+ You are an AI assistant with access to a custom math calculation tool and a weather information MCP tool.
26
+
27
+ The two_num_tool is available as a custom tool that can add two numbers together.
28
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
29
+
30
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
31
+ a clear, accurate result.
32
+
33
+ Weather tools are available via MCP sessions and will be called automatically by the system when needed.
34
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
35
+
36
+ When users ask about weather conditions, forecasts, or alerts, include the location and time frame in your
37
+ response and provide concise, up-to-date information using the integrated tools.
38
+ ui:
39
+ display_type: "simple"
40
+ logging_enabled: true
@@ -0,0 +1,38 @@
1
+ # MassGen Configuration: Claude Code with MCP Integration
2
+ # Usage:
3
+ # massgen --config @examples/tools/custom_tools/claude_code_custom_tool_with_wrong_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 custom tools and wrong 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: ["two_num_tool"]
17
+ mcp_servers:
18
+ - name: "weather"
19
+ type: "stdio"
20
+ command: "python"
21
+ args: ["-u", "-m", "aaa.bbb"] # Wrong MCP command to demonstrate error handling
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