Skip to content

feat: Add AutoGen Multi-Agent Code Editing Workflow - #6

Open
nteverysome wants to merge 1 commit into
masterfrom
feature/autogen-editing-workflow
Open

nteverysome wants to merge 1 commit into
masterfrom
feature/autogen-editing-workflow

Conversation

@nteverysome

Copy link
Copy Markdown
Owner

🚀 AutoGen 編輯工作流

本 PR 添加了一個完整的 AutoGen 多 Agent 代碼編輯工作流系統,實現了三個核心 Agent 的協作:

  • Agent1 (代碼編寫者): 負責編寫初始代碼
  • Agent2 (代碼審查者): 審查代碼並提出修改建議
  • Agent3 (代碼重構者): 根據審查建議重新修改代碼

📁 新增文件

  • code_editing_workflow_basic.py - 基礎線性工作流
  • code_editing_workflow_advanced.py - 高級條件循環工作流
  • code_editing_workflow_swarm.py - Swarm 模式工作流
  • run_example.py - 交互式演示腳本
  • AutoGen_Workflow_README.md - 完整使用文檔
  • requirements_autogen.txt - 依賴包列表

✨ 主要特性

  • ✅ 基於 AutoGen 最新版本 (v0.4+)
  • ✅ 三種工作流模式:GraphFlow、Swarm、條件循環
  • ✅ 完整的中文註釋和文檔
  • ✅ 錯誤處理和狀態管理
  • ✅ 交互式演示和多個示例任務
  • ✅ 支持 OpenAI GPT-4o 等最新模型

🔄 工作流類型

特性 基礎工作流 高級工作流 Swarm 工作流
執行模式 線性順序 條件循環 動態 Handoff
迭代改進
靈活性
複雜度 簡單 中等 複雜

🎯 使用方法

  1. 安裝依賴:pip install -r requirements_autogen.txt
  2. 設置 API Key:export OPENAI_API_KEY="your-key"
  3. 運行演示:python run_example.py

🧪 測試

  • 基礎工作流測試
  • 高級工作流條件邏輯測試
  • Swarm handoff 機制測試
  • 錯誤處理測試
  • 交互式演示測試

📚 技術實現

  • 使用 AutoGen v0.4+ 最新 API
  • 實現 AssistantAgentGraphFlowSwarm 等模式
  • 支持條件邊和消息過濾
  • 異步處理和狀態管理
  • 完整的類型提示和文檔

這個實現展示了 AutoGen 框架在多 Agent 協作方面的強大能力,為 EduCreate 平台增加了 AI Agent 協作的功能模塊。


Pull Request opened by Augment Code with guidance from the PR author

- Implement three workflow patterns: Basic, Advanced, and Swarm
- Basic workflow: Linear execution (coder → reviewer → refactor)
- Advanced workflow: Conditional loops with iterative improvement
- Swarm workflow: Dynamic handoff and flexible collaboration
- Include comprehensive Chinese documentation and examples
- Add interactive demo script with multiple task examples
- Support for OpenAI GPT-4o and other models
- Error handling and state management
- Based on AutoGen v0.4+ latest APIs and best practices

Files added:
- code_editing_workflow_basic.py: Simple linear workflow
- code_editing_workflow_advanced.py: Advanced conditional workflow
- code_editing_workflow_swarm.py: Swarm-based workflow
- run_example.py: Interactive demo script
- AutoGen_Workflow_README.md: Complete documentation
- requirements_autogen.txt: Dependencies list
@vercel

vercel Bot commented Jun 23, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
edu-create ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2025 5:09am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant