massgen 0.1.4__py3-none-any.whl → 0.1.6__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 (84) hide show
  1. massgen/__init__.py +1 -1
  2. massgen/backend/base_with_custom_tool_and_mcp.py +453 -23
  3. massgen/backend/capabilities.py +39 -0
  4. massgen/backend/chat_completions.py +111 -197
  5. massgen/backend/claude.py +210 -181
  6. massgen/backend/gemini.py +1015 -1559
  7. massgen/backend/grok.py +3 -2
  8. massgen/backend/response.py +160 -220
  9. massgen/chat_agent.py +340 -20
  10. massgen/cli.py +399 -25
  11. massgen/config_builder.py +20 -54
  12. massgen/config_validator.py +931 -0
  13. massgen/configs/README.md +95 -10
  14. massgen/configs/memory/gpt5mini_gemini_baseline_research_to_implementation.yaml +94 -0
  15. massgen/configs/memory/gpt5mini_gemini_context_window_management.yaml +187 -0
  16. massgen/configs/memory/gpt5mini_gemini_research_to_implementation.yaml +127 -0
  17. massgen/configs/memory/gpt5mini_high_reasoning_gemini.yaml +107 -0
  18. massgen/configs/memory/single_agent_compression_test.yaml +64 -0
  19. massgen/configs/tools/custom_tools/claude_code_custom_tool_with_mcp_example.yaml +1 -0
  20. massgen/configs/tools/custom_tools/claude_custom_tool_example_no_path.yaml +1 -1
  21. massgen/configs/tools/custom_tools/claude_custom_tool_with_mcp_example.yaml +1 -0
  22. massgen/configs/tools/custom_tools/computer_use_browser_example.yaml +1 -1
  23. massgen/configs/tools/custom_tools/computer_use_docker_example.yaml +1 -1
  24. massgen/configs/tools/custom_tools/gemini_custom_tool_with_mcp_example.yaml +1 -0
  25. massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_mcp_example.yaml +1 -0
  26. massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_mcp_example.yaml +1 -0
  27. massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_mcp_example.yaml +1 -0
  28. massgen/configs/tools/custom_tools/interop/ag2_and_langgraph_lesson_planner.yaml +65 -0
  29. massgen/configs/tools/custom_tools/interop/ag2_and_openai_assistant_lesson_planner.yaml +65 -0
  30. massgen/configs/tools/custom_tools/interop/ag2_lesson_planner_example.yaml +48 -0
  31. massgen/configs/tools/custom_tools/interop/agentscope_lesson_planner_example.yaml +48 -0
  32. massgen/configs/tools/custom_tools/interop/langgraph_lesson_planner_example.yaml +49 -0
  33. massgen/configs/tools/custom_tools/interop/openai_assistant_lesson_planner_example.yaml +50 -0
  34. massgen/configs/tools/custom_tools/interop/smolagent_lesson_planner_example.yaml +49 -0
  35. massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_mcp_example.yaml +1 -0
  36. massgen/configs/tools/custom_tools/two_models_with_tools_example.yaml +44 -0
  37. massgen/formatter/_gemini_formatter.py +61 -15
  38. massgen/memory/README.md +277 -0
  39. massgen/memory/__init__.py +26 -0
  40. massgen/memory/_base.py +193 -0
  41. massgen/memory/_compression.py +237 -0
  42. massgen/memory/_context_monitor.py +211 -0
  43. massgen/memory/_conversation.py +255 -0
  44. massgen/memory/_fact_extraction_prompts.py +333 -0
  45. massgen/memory/_mem0_adapters.py +257 -0
  46. massgen/memory/_persistent.py +687 -0
  47. massgen/memory/docker-compose.qdrant.yml +36 -0
  48. massgen/memory/docs/DESIGN.md +388 -0
  49. massgen/memory/docs/QUICKSTART.md +409 -0
  50. massgen/memory/docs/SUMMARY.md +319 -0
  51. massgen/memory/docs/agent_use_memory.md +408 -0
  52. massgen/memory/docs/orchestrator_use_memory.md +586 -0
  53. massgen/memory/examples.py +237 -0
  54. massgen/orchestrator.py +207 -7
  55. massgen/tests/memory/test_agent_compression.py +174 -0
  56. massgen/tests/memory/test_context_window_management.py +286 -0
  57. massgen/tests/memory/test_force_compression.py +154 -0
  58. massgen/tests/memory/test_simple_compression.py +147 -0
  59. massgen/tests/test_ag2_lesson_planner.py +223 -0
  60. massgen/tests/test_agent_memory.py +534 -0
  61. massgen/tests/test_config_validator.py +1156 -0
  62. massgen/tests/test_conversation_memory.py +382 -0
  63. massgen/tests/test_langgraph_lesson_planner.py +223 -0
  64. massgen/tests/test_orchestrator_memory.py +620 -0
  65. massgen/tests/test_persistent_memory.py +435 -0
  66. massgen/token_manager/token_manager.py +6 -0
  67. massgen/tool/__init__.py +2 -9
  68. massgen/tool/_decorators.py +52 -0
  69. massgen/tool/_extraframework_agents/ag2_lesson_planner_tool.py +251 -0
  70. massgen/tool/_extraframework_agents/agentscope_lesson_planner_tool.py +303 -0
  71. massgen/tool/_extraframework_agents/langgraph_lesson_planner_tool.py +275 -0
  72. massgen/tool/_extraframework_agents/openai_assistant_lesson_planner_tool.py +247 -0
  73. massgen/tool/_extraframework_agents/smolagent_lesson_planner_tool.py +180 -0
  74. massgen/tool/_manager.py +102 -16
  75. massgen/tool/_registered_tool.py +3 -0
  76. massgen/tool/_result.py +3 -0
  77. {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/METADATA +138 -77
  78. {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/RECORD +82 -37
  79. massgen/backend/gemini_mcp_manager.py +0 -545
  80. massgen/backend/gemini_trackers.py +0 -344
  81. {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/WHEEL +0 -0
  82. {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/entry_points.txt +0 -0
  83. {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/licenses/LICENSE +0 -0
  84. {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,64 @@
1
+ # Single Agent Compression Test
2
+ #
3
+ # Simple config to test per-agent memory and compression with ONE agent.
4
+ # Set very low thresholds to trigger compression quickly.
5
+ #
6
+ # Run with:
7
+ # uv run massgen --config massgen/configs/memory/single_agent_compression_test.yaml "Analyze the MassGen codebase comprehensively. Create an architecture document that explains: (1) Core components and their responsibilities, (2) How different modules interact, (3) Key design patterns used, (4) Main entry points and request flows. Read > 30 files to build a complete understanding."
8
+
9
+ agents:
10
+ - id: "test_agent"
11
+ backend:
12
+ type: "openai"
13
+ model: "gpt-5-nano"
14
+ cwd: "workspace1"
15
+
16
+ # Global memory configuration
17
+ memory:
18
+ enabled: true
19
+
20
+ conversation_memory:
21
+ enabled: true
22
+
23
+ persistent_memory:
24
+ enabled: true
25
+
26
+ # LLM for memory operations
27
+ llm:
28
+ provider: "openai"
29
+ model: "gpt-4.1-nano-2025-04-14"
30
+
31
+ # Embedding for vector search
32
+ embedding:
33
+ provider: "openai"
34
+ model: "text-embedding-3-small"
35
+
36
+ # Qdrant configuration (use server mode)
37
+ qdrant:
38
+ mode: "server"
39
+ host: "localhost"
40
+ port: 6333
41
+
42
+ compression:
43
+ trigger_threshold: 0.02 # Compress at 2% (very low for quick testing)
44
+ target_ratio: 0.01 # Keep 1% after compression
45
+
46
+ # Memory retrieval configuration
47
+ retrieval:
48
+ limit: 5 # Number of memory facts to retrieve from mem0 (default: 5)
49
+ exclude_recent: true # Only retrieve after compression to avoid duplicates (default: true)
50
+ # When true: retrieval skipped until compression occurs
51
+ # When false: always retrieve (may duplicate recent context)
52
+
53
+ # Orchestrator config
54
+ orchestrator:
55
+ snapshot_storage: "test_compression_sessions"
56
+ agent_temporary_workspace: "test_compression_workspace"
57
+ context_paths:
58
+ - path: "massgen"
59
+ permission: "read"
60
+
61
+ # UI
62
+ ui:
63
+ display_type: "rich_terminal"
64
+ logging_enabled: true
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: Claude Code with MCP Integration
2
2
  # Usage:
3
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
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/claude_code_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  orchestrator:
5
6
  snapshot_storage: "claude_code_snapshots"
6
7
  agent_temporary_workspace: "claude_code_temp"
@@ -18,5 +18,5 @@ agents:
18
18
  When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
19
19
  a clear, accurate result.
20
20
  ui:
21
- display_type: "simple"
21
+ display_type: "rich_terminal"
22
22
  logging_enabled: true
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: Claude with MCP Integration
2
2
  # Usage:
3
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
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/claude_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  agents:
5
6
  - id: "claude_custom_tool" # Anthropic Claude
6
7
  backend:
@@ -51,6 +51,6 @@ agents:
51
51
  - Be specific about what you're looking for on the page
52
52
 
53
53
  ui:
54
- display_type: "detailed"
54
+ display_type: "rich_terminal"
55
55
  logging_enabled: true
56
56
  show_screenshots: true
@@ -59,7 +59,7 @@ agents:
59
59
  - Consider screen resolution (1280x800)
60
60
 
61
61
  ui:
62
- display_type: "detailed"
62
+ display_type: "rich_terminal"
63
63
  logging_enabled: true
64
64
  show_screenshots: true
65
65
  show_reasoning: true
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: Gemini with MCP Integration
2
2
  # Usage:
3
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
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/gemini_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  agents:
5
6
  - id: "gemini2.5flash_custom_tool" # Google Gemini 2.5 Flash
6
7
  backend:
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: GPT-5 Nano with MCP Integration
2
2
  # Usage:
3
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
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  agents:
5
6
  - id: "gpt5_nano_custom_tool" # OpenAI GPT-5 Nano
6
7
  backend:
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: Gemini with MCP Integration
2
2
  # Usage:
3
3
  # massgen --config @examples/tools/custom_tools/gpt_oss_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  agents:
5
6
  - id: "gpt-oss-custom_tool" # Cerebras AI GPT-OSS
6
7
  backend:
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: Grok-3 Mini with MCP Integration
2
2
  # Usage:
3
3
  # massgen --config @examples/tools/custom_tools/grok3_mini_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  agents:
5
6
  - id: "grok3_mini_custom_tool"
6
7
  backend:
@@ -0,0 +1,65 @@
1
+ # MassGen Configuration: Lesson Planner Comparison
2
+ # This demonstrates interoperability by comparing AG2 and LangGraph lesson planner implementations
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/ag2_and_langgraph_lesson_planner.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/ag2_and_langgraph_lesson_planner.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration provides access to both AG2 (AutoGen) and LangGraph lesson planning tools,
10
+ # allowing you to compare different multi-agent framework approaches within MassGen.
11
+ #
12
+ # AG2 Version:
13
+ # - Uses AutoGen's nested chat architecture
14
+ # - Multiple agents in group chat collaboration
15
+ # - Demonstrates AutoGen → MassGen interoperability
16
+ #
17
+ # LangGraph Version:
18
+ # - Uses LangGraph's state graph architecture
19
+ # - Sequential workflow with state management
20
+ # - Demonstrates LangGraph → MassGen interoperability
21
+ #
22
+ # Requirements:
23
+ # - pip install pyautogen langgraph langchain-openai langchain-core
24
+ # - OPENAI_API_KEY environment variable must be set
25
+
26
+ agents:
27
+ - id: "ag2_planner" # AG2 (AutoGen) implementation
28
+ backend:
29
+ type: "openai"
30
+ model: "gpt-4o"
31
+ custom_tools:
32
+ - name: ["ag2_lesson_planner"]
33
+ category: "education"
34
+ path: "massgen/tool/_extraframework_agents/ag2_lesson_planner_tool.py"
35
+ function: ["ag2_lesson_planner"]
36
+ system_message: |
37
+ You are an AI assistant with access to the AG2 (AutoGen) lesson planning tool.
38
+
39
+ The ag2_lesson_planner tool creates comprehensive fourth-grade lesson plans using AutoGen's
40
+ nested chat architecture with multiple collaborative agents.
41
+
42
+ When users ask for a lesson plan, use the ag2_lesson_planner tool. After receiving the result,
43
+ present it clearly and mention that this was generated using the AG2 (AutoGen) framework.
44
+
45
+ - id: "langgraph_planner" # LangGraph implementation
46
+ backend:
47
+ type: "openai"
48
+ model: "gpt-4o"
49
+ custom_tools:
50
+ - name: ["langgraph_lesson_planner"]
51
+ category: "education"
52
+ path: "massgen/tool/_extraframework_agents/langgraph_lesson_planner_tool.py"
53
+ function: ["langgraph_lesson_planner"]
54
+ system_message: |
55
+ You are an AI assistant with access to the LangGraph lesson planning tool.
56
+
57
+ The langgraph_lesson_planner tool creates comprehensive fourth-grade lesson plans using
58
+ LangGraph's state graph architecture with sequential workflow nodes.
59
+
60
+ When users ask for a lesson plan, use the langgraph_lesson_planner tool. After receiving the result,
61
+ present it clearly and mention that this was generated using the LangGraph framework.
62
+
63
+ ui:
64
+ display_type: "rich_terminal"
65
+ logging_enabled: true
@@ -0,0 +1,65 @@
1
+ # MassGen Configuration: Lesson Planner Comparison
2
+ # This demonstrates interoperability by comparing AG2 and OpenAI Assistant lesson planner implementations
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/ag2_and_openai_assistant_lesson_planner.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/ag2_and_openai_assistant_lesson_planner.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration provides access to both AG2 (AutoGen) and OpenAI Assistant lesson planning tools,
10
+ # allowing you to compare different multi-agent framework approaches within MassGen.
11
+ #
12
+ # AG2 Version:
13
+ # - Uses AutoGen's nested chat architecture
14
+ # - Multiple agents in group chat collaboration
15
+ # - Demonstrates AutoGen → MassGen interoperability
16
+ #
17
+ # OpenAI Assistant Version:
18
+ # - Uses OpenAI's Chat Completions API with streaming
19
+ # - Multi-agent collaboration pattern with sequential workflow
20
+ # - Demonstrates OpenAI Assistant → MassGen interoperability
21
+ #
22
+ # Requirements:
23
+ # - pip install pyautogen openai
24
+ # - OPENAI_API_KEY environment variable must be set
25
+
26
+ agents:
27
+ - id: "ag2_planner" # AG2 (AutoGen) implementation
28
+ backend:
29
+ type: "openai"
30
+ model: "gpt-4o"
31
+ custom_tools:
32
+ - name: ["ag2_lesson_planner"]
33
+ category: "education"
34
+ path: "massgen/tool/_extraframework_agents/ag2_lesson_planner_tool.py"
35
+ function: ["ag2_lesson_planner"]
36
+ system_message: |
37
+ You are an AI assistant with access to the AG2 (AutoGen) lesson planning tool.
38
+
39
+ The ag2_lesson_planner tool creates comprehensive fourth-grade lesson plans using AutoGen's
40
+ nested chat architecture with multiple collaborative agents.
41
+
42
+ When users ask for a lesson plan, use the ag2_lesson_planner tool. After receiving the result,
43
+ present it clearly and mention that this was generated using the AG2 (AutoGen) framework.
44
+
45
+ - id: "openai_assistant_planner" # OpenAI Assistant implementation
46
+ backend:
47
+ type: "openai"
48
+ model: "gpt-4o"
49
+ custom_tools:
50
+ - name: ["openai_assistant_lesson_planner"]
51
+ category: "education"
52
+ path: "massgen/tool/_extraframework_agents/openai_assistant_lesson_planner_tool.py"
53
+ function: ["openai_assistant_lesson_planner"]
54
+ system_message: |
55
+ You are an AI assistant with access to the OpenAI Assistant lesson planning tool.
56
+
57
+ The openai_assistant_lesson_planner tool creates comprehensive fourth-grade lesson plans using
58
+ OpenAI's Chat Completions API with multi-agent collaboration pattern and streaming support.
59
+
60
+ When users ask for a lesson plan, use the openai_assistant_lesson_planner tool. After receiving the result,
61
+ present it clearly and mention that this was generated using the OpenAI Assistant framework.
62
+
63
+ ui:
64
+ display_type: "rich_terminal"
65
+ logging_enabled: true
@@ -0,0 +1,48 @@
1
+ # MassGen Configuration: AG2 (AutoGen) Lesson Planner Tool
2
+ # This demonstrates interoperability by using AutoGen's nested chat as a custom tool
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/ag2_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/ag2_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration uses the AG2 (AutoGen) nested chat architecture to create comprehensive
10
+ # lesson plans. The tool uses multiple AutoGen agents working together:
11
+ # - Curriculum Agent: Determines standards and objectives
12
+ # - Lesson Planner Agent: Creates detailed lesson plans
13
+ # - Lesson Reviewer Agent: Reviews and provides feedback
14
+ # - Lesson Formatter Agent: Formats the final output
15
+ #
16
+ # Requirements:
17
+ # - pip install pyautogen
18
+ # - OPENAI_API_KEY environment variable must be set
19
+
20
+ agents:
21
+ - id: "ag2_lesson_planner" # OpenAI GPT-4o with AG2 custom tool
22
+ backend:
23
+ type: "openai"
24
+ model: "gpt-4o"
25
+ custom_tools:
26
+ - name: ["ag2_lesson_planner"]
27
+ category: "education"
28
+ path: "massgen/tool/_extraframework_agents/ag2_lesson_planner_tool.py"
29
+ function: ["ag2_lesson_planner"]
30
+ system_message: |
31
+ You are an AI assistant with access to an advanced lesson planning tool powered by AutoGen.
32
+
33
+ The ag2_lesson_planner tool is available as a custom tool that creates comprehensive fourth-grade
34
+ lesson plans using a multi-agent collaborative approach. This tool demonstrates interoperability
35
+ between MassGen and AutoGen frameworks.
36
+
37
+ When users ask for a lesson plan on any topic, use the ag2_lesson_planner tool. The tool will coordinate multiple specialized agents to:
38
+ 1. Identify relevant curriculum standards and learning objectives
39
+ 2. Design engaging lesson activities with proper timing
40
+ 3. Review the plan for age-appropriateness and effectiveness
41
+ 4. Format the final lesson plan in a structured format
42
+
43
+ After receiving the lesson plan, present it clearly to the user and offer to make any adjustments
44
+ they'd like.
45
+
46
+ ui:
47
+ display_type: "rich_terminal"
48
+ logging_enabled: true
@@ -0,0 +1,48 @@
1
+ # MassGen Configuration: AgentScope Lesson Planner Tool
2
+ # This demonstrates interoperability by using AgentScope's multi-agent framework as a custom tool
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/agentscope_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/agentscope_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration uses AgentScope to create comprehensive lesson plans through a multi-agent
10
+ # sequential pipeline. The tool uses multiple specialized AgentScope DialogAgents:
11
+ # - Curriculum Standards Expert: Determines standards and objectives
12
+ # - Lesson Planning Specialist: Creates detailed lesson plans
13
+ # - Lesson Plan Reviewer: Reviews and improves the plan
14
+ # - Lesson Plan Formatter: Formats the final output
15
+ #
16
+ # Requirements:
17
+ # - pip install agentscope
18
+ # - OPENAI_API_KEY environment variable must be set
19
+
20
+ agents:
21
+ - id: "agentscope_lesson_planner" # OpenAI GPT-4o with AgentScope custom tool
22
+ backend:
23
+ type: "openai"
24
+ model: "gpt-4o"
25
+ custom_tools:
26
+ - name: ["agentscope_lesson_planner"]
27
+ category: "education"
28
+ path: "massgen/tool/_extraframework_agents/agentscope_lesson_planner_tool.py"
29
+ function: ["agentscope_lesson_planner"]
30
+ system_message: |
31
+ You are an AI assistant with access to an advanced lesson planning tool powered by AgentScope.
32
+
33
+ The agentscope_lesson_planner tool is available as a custom tool that creates comprehensive fourth-grade
34
+ lesson plans using AgentScope's multi-agent framework. This tool demonstrates interoperability
35
+ between MassGen and AgentScope.
36
+
37
+ When users ask for a lesson plan on any topic, use the agentscope_lesson_planner tool. The tool will coordinate multiple specialized agents in a sequential pipeline to:
38
+ 1. Identify relevant curriculum standards and learning objectives
39
+ 2. Design engaging lesson activities with proper timing
40
+ 3. Review the plan for age-appropriateness and effectiveness
41
+ 4. Format the final lesson plan in a structured format
42
+
43
+ After receiving the lesson plan, present it clearly to the user and offer to make any adjustments
44
+ they'd like.
45
+
46
+ ui:
47
+ display_type: "rich_terminal"
48
+ logging_enabled: true
@@ -0,0 +1,49 @@
1
+ # MassGen Configuration: LangGraph Lesson Planner Tool
2
+ # This demonstrates interoperability by using LangGraph's state graph framework as a custom tool
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/langgraph_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/langgraph_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration uses LangGraph to create comprehensive lesson plans through a state graph
10
+ # workflow. The tool orchestrates multiple specialized nodes in a sequential graph:
11
+ # - Curriculum Node: Determines standards and objectives
12
+ # - Planner Node: Creates detailed lesson plans
13
+ # - Reviewer Node: Reviews and improves the plan
14
+ # - Formatter Node: Formats the final output
15
+ #
16
+ # Requirements:
17
+ # - pip install langgraph langchain-openai langchain-core
18
+ # - OPENAI_API_KEY environment variable must be set
19
+
20
+ agents:
21
+ - id: "langgraph_lesson_planner" # OpenAI GPT-4o with LangGraph custom tool
22
+ backend:
23
+ type: "openai"
24
+ model: "gpt-4o"
25
+ custom_tools:
26
+ - name: ["langgraph_lesson_planner"]
27
+ category: "education"
28
+ path: "massgen/tool/_extraframework_agents/langgraph_lesson_planner_tool.py"
29
+ function: ["langgraph_lesson_planner"]
30
+ system_message: |
31
+ You are an AI assistant with access to an advanced lesson planning tool powered by LangGraph.
32
+
33
+ The langgraph_lesson_planner tool is available as a custom tool that creates comprehensive fourth-grade
34
+ lesson plans using LangGraph's state graph architecture. This tool demonstrates interoperability
35
+ between MassGen and LangGraph/LangChain frameworks.
36
+
37
+ When users ask for a lesson plan on any topic, use the langgraph_lesson_planner tool. The tool will execute
38
+ a state graph workflow with multiple nodes to:
39
+ 1. Identify relevant curriculum standards and learning objectives
40
+ 2. Design engaging lesson activities with proper timing
41
+ 3. Review the plan for age-appropriateness and effectiveness
42
+ 4. Format the final lesson plan in a structured format
43
+
44
+ After receiving the lesson plan, present it clearly to the user and offer to make any adjustments
45
+ they'd like.
46
+
47
+ ui:
48
+ display_type: "rich_terminal"
49
+ logging_enabled: true
@@ -0,0 +1,50 @@
1
+ # MassGen Configuration: OpenAI Lesson Planner Tool
2
+ # This demonstrates interoperability by using OpenAI's Chat Completions API as a custom tool
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/openai_assistant_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/openai_assistant_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration uses OpenAI's Chat Completions API with multi-agent collaboration to create comprehensive lesson plans.
10
+ # The tool uses multiple specialized agents (similar to AG2) that work sequentially:
11
+ # 1. Curriculum Agent: Identifies relevant curriculum standards and learning objectives
12
+ # 2. Lesson Planner Agent: Designs engaging lesson activities with proper timing
13
+ # 3. Lesson Reviewer Agent: Reviews the plan for age-appropriateness and effectiveness
14
+ # 4. Formatter Agent: Formats the final lesson plan in a structured format
15
+ # This demonstrates interoperability between MassGen and OpenAI's API using a role-based collaboration pattern.
16
+ #
17
+ # Requirements:
18
+ # - pip install openai
19
+ # - OPENAI_API_KEY environment variable must be set
20
+
21
+ agents:
22
+ - id: "openai_assistant_lesson_planner" # OpenAI GPT-4o with OpenAI Assistant custom tool
23
+ backend:
24
+ type: "openai"
25
+ model: "gpt-4o"
26
+ custom_tools:
27
+ - name: ["openai_assistant_lesson_planner"]
28
+ category: "education"
29
+ path: "massgen/tool/_extraframework_agents/openai_assistant_lesson_planner_tool.py"
30
+ function: ["openai_assistant_lesson_planner"]
31
+ system_message: |
32
+ You are an AI assistant with access to an advanced lesson planning tool powered by OpenAI's Chat Completions API.
33
+
34
+ The openai_assistant_lesson_planner tool is available as a custom tool that creates comprehensive fourth-grade
35
+ lesson plans using OpenAI's Chat Completions API with multi-agent collaboration (similar to AG2/AutoGen pattern).
36
+ This tool demonstrates interoperability between MassGen and OpenAI's framework.
37
+
38
+ When users ask for a lesson plan on any topic, use the openai_assistant_lesson_planner tool. The tool uses
39
+ multiple specialized agents that collaborate sequentially:
40
+ 1. Curriculum Agent: Identifies relevant curriculum standards and learning objectives
41
+ 2. Lesson Planner Agent: Designs engaging lesson activities with proper timing
42
+ 3. Lesson Reviewer Agent: Reviews the plan for age-appropriateness and effectiveness
43
+ 4. Formatter Agent: Formats the final lesson plan in a structured format
44
+
45
+ After receiving the lesson plan, present it clearly to the user and offer to make any adjustments
46
+ they'd like.
47
+
48
+ ui:
49
+ display_type: "rich_terminal"
50
+ logging_enabled: true
@@ -0,0 +1,49 @@
1
+ # MassGen Configuration: SmolAgent Lesson Planner Tool
2
+ # This demonstrates interoperability by using HuggingFace's SmolAgent as a custom tool
3
+ #
4
+ # Usage:
5
+ # massgen --config @examples/tools/custom_tools/interop/smolagent_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
6
+ # uv run python -m massgen.cli --config @examples/tools/custom_tools/interop/smolagent_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
7
+ #
8
+ # Description:
9
+ # This configuration uses SmolAgent (HuggingFace's lightweight agent framework) to create comprehensive
10
+ # lesson plans. The tool uses SmolAgent's CodeAgent with custom tools:
11
+ # - get_curriculum_standards: Determines standards and objectives
12
+ # - create_lesson_plan: Creates detailed lesson plans
13
+ # - review_lesson_plan: Reviews and provides feedback
14
+ # - format_lesson_plan: Formats the final output
15
+ #
16
+ # Requirements:
17
+ # - pip install smolagents
18
+ # - OPENAI_API_KEY environment variable must be set
19
+
20
+ agents:
21
+ - id: "smolagent_lesson_planner" # OpenAI GPT-4o with SmolAgent custom tool
22
+ backend:
23
+ type: "openai"
24
+ model: "gpt-4o"
25
+ custom_tools:
26
+ - name: ["smolagent_lesson_planner"]
27
+ category: "education"
28
+ path: "massgen/tool/_extraframework_agents/smolagent_lesson_planner_tool.py"
29
+ function: ["smolagent_lesson_planner"]
30
+ system_message: |
31
+ You are an AI assistant with access to an advanced lesson planning tool powered by SmolAgent.
32
+
33
+ The smolagent_lesson_planner tool is available as a custom tool that creates comprehensive fourth-grade
34
+ lesson plans using HuggingFace's SmolAgent framework. This tool demonstrates interoperability
35
+ between MassGen and SmolAgent.
36
+
37
+ When users ask for a lesson plan on any topic, use the smolagent_lesson_planner tool. The tool will use
38
+ multiple custom tools to:
39
+ 1. Identify relevant curriculum standards and learning objectives
40
+ 2. Design engaging lesson activities with proper timing
41
+ 3. Review the plan for age-appropriateness and effectiveness
42
+ 4. Format the final lesson plan in a structured format
43
+
44
+ After receiving the lesson plan, present it clearly to the user and offer to make any adjustments
45
+ they'd like.
46
+
47
+ ui:
48
+ display_type: "rich_terminal"
49
+ logging_enabled: true
@@ -1,6 +1,7 @@
1
1
  # MassGen Configuration: Qwen API with MCP Integration
2
2
  # Usage:
3
3
  # massgen --config @examples/tools/custom_tools/qwen_api_custom_tool_with_mcp_example "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_mcp_example.yaml "whats the sum of 123 and 456? and whats the weather of Tokyo?"
4
5
  agents:
5
6
  - id: "qwen-mcp_weather" # Cerebras AI
6
7
  backend:
@@ -0,0 +1,44 @@
1
+ # MassGen Configuration: Two Models with Custom Tools
2
+ # Usage:
3
+ # massgen --config massgen/configs/tools/custom_tools/two_models_with_tools_example.yaml "whats the sum of 123 and 456, and also 789 and 012?"
4
+ # uv run python -m massgen.cli --config massgen/configs/tools/custom_tools/two_models_with_tools_example.yaml "whats the sum of 123 and 456, and also 789 and 012?"
5
+ agents:
6
+ - id: "claude_agent_with_tools" # Anthropic Claude Agent
7
+ backend:
8
+ type: "claude"
9
+ model: "claude-sonnet-4-20250514"
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 Claude, an AI assistant with access to custom math calculation tools.
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
+
24
+ - id: "gemini_agent_with_tools" # Google Gemini Agent
25
+ backend:
26
+ type: "gemini"
27
+ model: "gemini-2.5-flash"
28
+ custom_tools:
29
+ - name: ["two_num_tool"]
30
+ category: "math"
31
+ path: "massgen/tool/_basic/_two_num_tool.py"
32
+ function: ["two_num_tool"]
33
+ system_message: |
34
+ You are Gemini, an AI assistant with access to custom math calculation tools.
35
+
36
+ The two_num_tool is available as a custom tool that can add two numbers together.
37
+ Do not output tool call syntax or function declarations. Focus on answering the user's question clearly.
38
+
39
+ When users ask about adding two numbers together, use the two_num_tool to calculate the sum and provide
40
+ a clear, accurate result.
41
+
42
+ ui:
43
+ display_type: "rich_terminal"
44
+ logging_enabled: true