主函数
()
| 2502 | |
| 2503 | |
| 2504 | def main(): |
| 2505 | """主函数""" |
| 2506 | import argparse |
| 2507 | |
| 2508 | parser = argparse.ArgumentParser(description="Master Coordinator - 主协调器") |
| 2509 | parser.add_argument("--user-id", type=str, default="user_001", help="用户 ID") |
| 2510 | parser.add_argument("--message", type=str, required=True, help="用户消息") |
| 2511 | parser.add_argument("--feishu-user-id", type=str, help="飞书用户 ID") |
| 2512 | parser.add_argument("--no-feishu", action="store_true", help="不发送飞书") |
| 2513 | |
| 2514 | args = parser.parse_args() |
| 2515 | |
| 2516 | coordinator = MasterCoordinator( |
| 2517 | user_id=args.user_id, |
| 2518 | feishu_user_id=args.feishu_user_id, |
| 2519 | send_to_feishu=not args.no_feishu, |
| 2520 | ) |
| 2521 | |
| 2522 | result = coordinator.process(args.message) |
| 2523 | print(f"\n最终结果:{json.dumps(result, indent=2, ensure_ascii=False)}") |
| 2524 | |
| 2525 | |
| 2526 | if __name__ == "__main__": |
no test coverage detected