massgen 0.0.3__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 (76) hide show
  1. massgen/__init__.py +94 -0
  2. massgen/agent_config.py +507 -0
  3. massgen/backend/CLAUDE_API_RESEARCH.md +266 -0
  4. massgen/backend/Function calling openai responses.md +1161 -0
  5. massgen/backend/GEMINI_API_DOCUMENTATION.md +410 -0
  6. massgen/backend/OPENAI_RESPONSES_API_FORMAT.md +65 -0
  7. massgen/backend/__init__.py +25 -0
  8. massgen/backend/base.py +180 -0
  9. massgen/backend/chat_completions.py +228 -0
  10. massgen/backend/claude.py +661 -0
  11. massgen/backend/gemini.py +652 -0
  12. massgen/backend/grok.py +187 -0
  13. massgen/backend/response.py +397 -0
  14. massgen/chat_agent.py +440 -0
  15. massgen/cli.py +686 -0
  16. massgen/configs/README.md +293 -0
  17. massgen/configs/creative_team.yaml +53 -0
  18. massgen/configs/gemini_4o_claude.yaml +31 -0
  19. massgen/configs/news_analysis.yaml +51 -0
  20. massgen/configs/research_team.yaml +51 -0
  21. massgen/configs/single_agent.yaml +18 -0
  22. massgen/configs/single_flash2.5.yaml +44 -0
  23. massgen/configs/technical_analysis.yaml +51 -0
  24. massgen/configs/three_agents_default.yaml +31 -0
  25. massgen/configs/travel_planning.yaml +51 -0
  26. massgen/configs/two_agents.yaml +39 -0
  27. massgen/frontend/__init__.py +20 -0
  28. massgen/frontend/coordination_ui.py +945 -0
  29. massgen/frontend/displays/__init__.py +24 -0
  30. massgen/frontend/displays/base_display.py +83 -0
  31. massgen/frontend/displays/rich_terminal_display.py +3497 -0
  32. massgen/frontend/displays/simple_display.py +93 -0
  33. massgen/frontend/displays/terminal_display.py +381 -0
  34. massgen/frontend/logging/__init__.py +9 -0
  35. massgen/frontend/logging/realtime_logger.py +197 -0
  36. massgen/message_templates.py +431 -0
  37. massgen/orchestrator.py +1222 -0
  38. massgen/tests/__init__.py +10 -0
  39. massgen/tests/multi_turn_conversation_design.md +214 -0
  40. massgen/tests/multiturn_llm_input_analysis.md +189 -0
  41. massgen/tests/test_case_studies.md +113 -0
  42. massgen/tests/test_claude_backend.py +310 -0
  43. massgen/tests/test_grok_backend.py +160 -0
  44. massgen/tests/test_message_context_building.py +293 -0
  45. massgen/tests/test_rich_terminal_display.py +378 -0
  46. massgen/tests/test_v3_3agents.py +117 -0
  47. massgen/tests/test_v3_simple.py +216 -0
  48. massgen/tests/test_v3_three_agents.py +272 -0
  49. massgen/tests/test_v3_two_agents.py +176 -0
  50. massgen/utils.py +79 -0
  51. massgen/v1/README.md +330 -0
  52. massgen/v1/__init__.py +91 -0
  53. massgen/v1/agent.py +605 -0
  54. massgen/v1/agents.py +330 -0
  55. massgen/v1/backends/gemini.py +584 -0
  56. massgen/v1/backends/grok.py +410 -0
  57. massgen/v1/backends/oai.py +571 -0
  58. massgen/v1/cli.py +351 -0
  59. massgen/v1/config.py +169 -0
  60. massgen/v1/examples/fast-4o-mini-config.yaml +44 -0
  61. massgen/v1/examples/fast_config.yaml +44 -0
  62. massgen/v1/examples/production.yaml +70 -0
  63. massgen/v1/examples/single_agent.yaml +39 -0
  64. massgen/v1/logging.py +974 -0
  65. massgen/v1/main.py +368 -0
  66. massgen/v1/orchestrator.py +1138 -0
  67. massgen/v1/streaming_display.py +1190 -0
  68. massgen/v1/tools.py +160 -0
  69. massgen/v1/types.py +245 -0
  70. massgen/v1/utils.py +199 -0
  71. massgen-0.0.3.dist-info/METADATA +568 -0
  72. massgen-0.0.3.dist-info/RECORD +76 -0
  73. massgen-0.0.3.dist-info/WHEEL +5 -0
  74. massgen-0.0.3.dist-info/entry_points.txt +2 -0
  75. massgen-0.0.3.dist-info/licenses/LICENSE +204 -0
  76. massgen-0.0.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,24 @@
1
+ """
2
+ MassGen Display Components
3
+
4
+ Provides various display interfaces for MassGen coordination visualization.
5
+ """
6
+
7
+ from .base_display import BaseDisplay
8
+ from .terminal_display import TerminalDisplay
9
+ from .simple_display import SimpleDisplay
10
+ from .rich_terminal_display import (
11
+ RichTerminalDisplay,
12
+ is_rich_available,
13
+ create_rich_display,
14
+ )
15
+
16
+ __all__ = [
17
+ "BaseDisplay",
18
+ "TerminalDisplay",
19
+ "SimpleDisplay",
20
+ "RichTerminalDisplay",
21
+ "is_rich_available",
22
+ "is_textual_available",
23
+ "create_rich_display",
24
+ ]
@@ -0,0 +1,83 @@
1
+ """
2
+ Base Display Interface for MassGen Coordination
3
+
4
+ Defines the interface that all display implementations must follow.
5
+ """
6
+
7
+ from abc import ABC, abstractmethod
8
+ from typing import Dict, List, Any, Optional
9
+
10
+
11
+ class BaseDisplay(ABC):
12
+ """Abstract base class for MassGen coordination displays."""
13
+
14
+ def __init__(self, agent_ids: List[str], **kwargs):
15
+ """Initialize display with agent IDs and configuration."""
16
+ self.agent_ids = agent_ids
17
+ self.agent_outputs = {agent_id: [] for agent_id in agent_ids}
18
+ self.agent_status = {agent_id: "waiting" for agent_id in agent_ids}
19
+ self.orchestrator_events = []
20
+ self.config = kwargs
21
+
22
+ @abstractmethod
23
+ def initialize(self, question: str, log_filename: Optional[str] = None):
24
+ """Initialize the display with question and optional log file."""
25
+ pass
26
+
27
+ @abstractmethod
28
+ def update_agent_content(
29
+ self, agent_id: str, content: str, content_type: str = "thinking"
30
+ ):
31
+ """Update content for a specific agent.
32
+
33
+ Args:
34
+ agent_id: The agent whose content to update
35
+ content: The content to add/update
36
+ content_type: Type of content ("thinking", "tool", "status")
37
+ """
38
+ pass
39
+
40
+ @abstractmethod
41
+ def update_agent_status(self, agent_id: str, status: str):
42
+ """Update status for a specific agent.
43
+
44
+ Args:
45
+ agent_id: The agent whose status to update
46
+ status: New status ("waiting", "working", "completed")
47
+ """
48
+ pass
49
+
50
+ @abstractmethod
51
+ def add_orchestrator_event(self, event: str):
52
+ """Add an orchestrator coordination event.
53
+
54
+ Args:
55
+ event: The coordination event message
56
+ """
57
+ pass
58
+
59
+ @abstractmethod
60
+ def show_final_answer(self, answer: str):
61
+ """Display the final coordinated answer.
62
+
63
+ Args:
64
+ answer: The final coordinated answer
65
+ """
66
+ pass
67
+
68
+ @abstractmethod
69
+ def cleanup(self):
70
+ """Clean up display resources."""
71
+ pass
72
+
73
+ def get_agent_content(self, agent_id: str) -> List[str]:
74
+ """Get all content for a specific agent."""
75
+ return self.agent_outputs.get(agent_id, [])
76
+
77
+ def get_agent_status(self, agent_id: str) -> str:
78
+ """Get current status for a specific agent."""
79
+ return self.agent_status.get(agent_id, "unknown")
80
+
81
+ def get_orchestrator_events(self) -> List[str]:
82
+ """Get all orchestrator events."""
83
+ return self.orchestrator_events.copy()