massgen 0.1.2__py3-none-any.whl → 0.1.4__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.
- massgen/__init__.py +1 -1
- massgen/agent_config.py +33 -7
- massgen/api_params_handler/_api_params_handler_base.py +3 -0
- massgen/api_params_handler/_chat_completions_api_params_handler.py +4 -0
- massgen/api_params_handler/_claude_api_params_handler.py +4 -0
- massgen/api_params_handler/_gemini_api_params_handler.py +4 -0
- massgen/api_params_handler/_response_api_params_handler.py +4 -0
- massgen/backend/azure_openai.py +9 -1
- massgen/backend/base.py +4 -0
- massgen/backend/base_with_custom_tool_and_mcp.py +25 -5
- massgen/backend/claude_code.py +9 -1
- massgen/backend/docs/permissions_and_context_files.md +2 -2
- massgen/backend/gemini.py +35 -6
- massgen/backend/gemini_utils.py +30 -0
- massgen/backend/response.py +2 -0
- massgen/chat_agent.py +9 -3
- massgen/cli.py +291 -43
- massgen/config_builder.py +163 -18
- massgen/configs/README.md +69 -14
- massgen/configs/debug/restart_test_controlled.yaml +60 -0
- massgen/configs/debug/restart_test_controlled_filesystem.yaml +73 -0
- massgen/configs/tools/code-execution/docker_with_sudo.yaml +35 -0
- massgen/configs/tools/custom_tools/computer_use_browser_example.yaml +56 -0
- massgen/configs/tools/custom_tools/computer_use_docker_example.yaml +65 -0
- massgen/configs/tools/custom_tools/computer_use_example.yaml +50 -0
- massgen/configs/tools/custom_tools/crawl4ai_example.yaml +55 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_file_generation_multi.yaml +61 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_file_generation_single.yaml +29 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_image_generation_multi.yaml +51 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_image_generation_single.yaml +33 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_speech_generation_multi.yaml +55 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_speech_generation_single.yaml +33 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_video_generation_multi.yaml +47 -0
- massgen/configs/tools/custom_tools/multimodal_tools/text_to_video_generation_single.yaml +29 -0
- massgen/configs/tools/custom_tools/multimodal_tools/understand_audio.yaml +33 -0
- massgen/configs/tools/custom_tools/multimodal_tools/understand_file.yaml +34 -0
- massgen/configs/tools/custom_tools/multimodal_tools/understand_image.yaml +33 -0
- massgen/configs/tools/custom_tools/multimodal_tools/understand_video.yaml +34 -0
- massgen/configs/tools/custom_tools/multimodal_tools/youtube_video_analysis.yaml +59 -0
- massgen/docker/README.md +83 -0
- massgen/filesystem_manager/_code_execution_server.py +22 -7
- massgen/filesystem_manager/_docker_manager.py +21 -1
- massgen/filesystem_manager/_filesystem_manager.py +9 -0
- massgen/filesystem_manager/_path_permission_manager.py +148 -0
- massgen/filesystem_manager/_workspace_tools_server.py +0 -997
- massgen/formatter/_gemini_formatter.py +73 -0
- massgen/frontend/coordination_ui.py +175 -257
- massgen/frontend/displays/base_display.py +29 -0
- massgen/frontend/displays/rich_terminal_display.py +155 -9
- massgen/frontend/displays/simple_display.py +21 -0
- massgen/frontend/displays/terminal_display.py +22 -2
- massgen/logger_config.py +50 -6
- massgen/message_templates.py +283 -15
- massgen/orchestrator.py +335 -38
- massgen/tests/test_binary_file_blocking.py +274 -0
- massgen/tests/test_case_studies.md +12 -12
- massgen/tests/test_code_execution.py +178 -0
- massgen/tests/test_multimodal_size_limits.py +407 -0
- massgen/tests/test_orchestration_restart.py +204 -0
- massgen/tool/__init__.py +4 -0
- massgen/tool/_manager.py +7 -2
- massgen/tool/_multimodal_tools/image_to_image_generation.py +293 -0
- massgen/tool/_multimodal_tools/text_to_file_generation.py +455 -0
- massgen/tool/_multimodal_tools/text_to_image_generation.py +222 -0
- massgen/tool/_multimodal_tools/text_to_speech_continue_generation.py +226 -0
- massgen/tool/_multimodal_tools/text_to_speech_transcription_generation.py +217 -0
- massgen/tool/_multimodal_tools/text_to_video_generation.py +223 -0
- massgen/tool/_multimodal_tools/understand_audio.py +211 -0
- massgen/tool/_multimodal_tools/understand_file.py +555 -0
- massgen/tool/_multimodal_tools/understand_image.py +316 -0
- massgen/tool/_multimodal_tools/understand_video.py +340 -0
- massgen/tool/_web_tools/crawl4ai_tool.py +718 -0
- massgen/tool/docs/multimodal_tools.md +1368 -0
- massgen/tool/workflow_toolkits/__init__.py +26 -0
- massgen/tool/workflow_toolkits/post_evaluation.py +216 -0
- massgen/utils.py +1 -0
- {massgen-0.1.2.dist-info → massgen-0.1.4.dist-info}/METADATA +101 -69
- {massgen-0.1.2.dist-info → massgen-0.1.4.dist-info}/RECORD +82 -46
- {massgen-0.1.2.dist-info → massgen-0.1.4.dist-info}/WHEEL +0 -0
- {massgen-0.1.2.dist-info → massgen-0.1.4.dist-info}/entry_points.txt +0 -0
- {massgen-0.1.2.dist-info → massgen-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {massgen-0.1.2.dist-info → massgen-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -75,6 +75,21 @@ class GeminiFormatter(FormatterBase):
|
|
|
75
75
|
|
|
76
76
|
return "vote" in tool_names and "new_answer" in tool_names
|
|
77
77
|
|
|
78
|
+
def has_post_evaluation_tools(self, tools: List[Dict[str, Any]]) -> bool:
|
|
79
|
+
"""Detect if tools contain submit/restart_orchestration post-evaluation tools."""
|
|
80
|
+
if not tools:
|
|
81
|
+
return False
|
|
82
|
+
|
|
83
|
+
tool_names = set()
|
|
84
|
+
for tool in tools:
|
|
85
|
+
if tool.get("type") == "function":
|
|
86
|
+
if "function" in tool:
|
|
87
|
+
tool_names.add(tool["function"].get("name", ""))
|
|
88
|
+
elif "name" in tool:
|
|
89
|
+
tool_names.add(tool.get("name", ""))
|
|
90
|
+
|
|
91
|
+
return "submit" in tool_names and "restart_orchestration" in tool_names
|
|
92
|
+
|
|
78
93
|
def build_structured_output_prompt(self, base_content: str, valid_agent_ids: Optional[List[str]] = None) -> str:
|
|
79
94
|
"""Build prompt that encourages structured output for coordination."""
|
|
80
95
|
agent_list = ""
|
|
@@ -104,6 +119,33 @@ If you want to provide a NEW ANSWER:
|
|
|
104
119
|
}}
|
|
105
120
|
}}
|
|
106
121
|
|
|
122
|
+
Make your decision and include the JSON at the very end of your response."""
|
|
123
|
+
|
|
124
|
+
def build_post_evaluation_prompt(self, base_content: str) -> str:
|
|
125
|
+
"""Build prompt that encourages structured output for post-evaluation."""
|
|
126
|
+
return f"""{base_content}
|
|
127
|
+
|
|
128
|
+
IMPORTANT: You must respond with a structured JSON decision at the end of your response.
|
|
129
|
+
|
|
130
|
+
If you want to SUBMIT the answer (it's complete and satisfactory):
|
|
131
|
+
{{
|
|
132
|
+
"action_type": "submit",
|
|
133
|
+
"submit_data": {{
|
|
134
|
+
"action": "submit",
|
|
135
|
+
"confirmed": true
|
|
136
|
+
}}
|
|
137
|
+
}}
|
|
138
|
+
|
|
139
|
+
If you want to RESTART with improvements:
|
|
140
|
+
{{
|
|
141
|
+
"action_type": "restart",
|
|
142
|
+
"restart_data": {{
|
|
143
|
+
"action": "restart",
|
|
144
|
+
"reason": "Clear explanation of why the answer is insufficient",
|
|
145
|
+
"instructions": "Detailed, actionable guidance for the next attempt"
|
|
146
|
+
}}
|
|
147
|
+
}}
|
|
148
|
+
|
|
107
149
|
Make your decision and include the JSON at the very end of your response."""
|
|
108
150
|
|
|
109
151
|
def extract_structured_response(self, response_text: str) -> Optional[Dict[str, Any]]:
|
|
@@ -192,6 +234,7 @@ Make your decision and include the JSON at the very end of your response."""
|
|
|
192
234
|
"""Convert structured response to tool call format."""
|
|
193
235
|
action_type = structured_response.get("action_type")
|
|
194
236
|
|
|
237
|
+
# Coordination tools
|
|
195
238
|
if action_type == "vote":
|
|
196
239
|
vote_data = structured_response.get("vote_data", {})
|
|
197
240
|
return [
|
|
@@ -221,6 +264,36 @@ Make your decision and include the JSON at the very end of your response."""
|
|
|
221
264
|
},
|
|
222
265
|
]
|
|
223
266
|
|
|
267
|
+
# Post-evaluation tools
|
|
268
|
+
elif action_type == "submit":
|
|
269
|
+
submit_data = structured_response.get("submit_data", {})
|
|
270
|
+
return [
|
|
271
|
+
{
|
|
272
|
+
"id": f"submit_{abs(hash(str(submit_data))) % 10000 + 1}",
|
|
273
|
+
"type": "function",
|
|
274
|
+
"function": {
|
|
275
|
+
"name": "submit",
|
|
276
|
+
"arguments": {"confirmed": submit_data.get("confirmed", True)},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
]
|
|
280
|
+
|
|
281
|
+
elif action_type == "restart":
|
|
282
|
+
restart_data = structured_response.get("restart_data", {})
|
|
283
|
+
return [
|
|
284
|
+
{
|
|
285
|
+
"id": f"restart_{abs(hash(str(restart_data))) % 10000 + 1}",
|
|
286
|
+
"type": "function",
|
|
287
|
+
"function": {
|
|
288
|
+
"name": "restart_orchestration",
|
|
289
|
+
"arguments": {
|
|
290
|
+
"reason": restart_data.get("reason", ""),
|
|
291
|
+
"instructions": restart_data.get("instructions", ""),
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
]
|
|
296
|
+
|
|
224
297
|
return []
|
|
225
298
|
|
|
226
299
|
# Custom tools formatting for Gemini
|