(self, user_input: str)
| 21 | ) |
| 22 | |
| 23 | def run(self, user_input: str) -> None: |
| 24 | graph = self.workflow_manager.get_graph() |
| 25 | |
| 26 | # Use factory function for consistent state initialization |
| 27 | initial_state = create_initial_state(user_input) |
| 28 | |
| 29 | events = graph.stream( |
| 30 | initial_state, |
| 31 | {"configurable": {"thread_id": "1"}, "recursion_limit": 3000}, |
| 32 | stream_mode="values", |
| 33 | debug=False |
| 34 | ) |
| 35 | |
| 36 | for event in events: |
| 37 | message = event["messages"][-1] |
| 38 | if isinstance(message, tuple): |
| 39 | print(message, end='', flush=True) |
| 40 | else: |
| 41 | message.pretty_print() |
| 42 | |
| 43 | if __name__ == "__main__": |
| 44 | system = MultiAgentSystem() |
no test coverage detected