-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add user requirements analysis feature #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…dition + simplified questions generated
|
@MonkeyCode-AI review this pr plz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request 概述
该 PR 实现了用户需求分析功能,通过 AI 生成引导性问题帮助用户明确项目需求。主要变更包括:
- 新增了
RequirementAnalysisAgent来处理需求分析 - 在 UI 中增加了引导分析模式和相关组件
- 扩展了工作流引擎以支持新的需求分析流程
文件变更说明
prompts/code_prompts.py: 添加了需求分析相关的提示词索引prompts/requirement_analysis_prompts.py: 新增文件,包含需求分析的提示词模板ui/components.py: 添加了引导分析模式的 UI 组件ui/handlers.py: 增加了处理需求分析工作流的异步函数和会话状态管理ui/layout.py: 修改了输入界面的渲染逻辑以支持新功能workflows/agent_orchestration_engine.py: 添加了需求分析代理的执行逻辑workflows/agents/requirement_analysis_agent.py: 新增文件,实现了需求分析的核心代理逻辑
该实现增强了用户与系统交互的方式,有助于生成更精确的代码实现。
| - PAPER_CONCEPT_ANALYSIS_PROMPT: 专注系统架构,突出概念到代码的映射 | ||
| - CODE_PLANNING_PROMPT: 整合前两者输出,生成高质量复现计划 | ||
| NEW: 用户需求分析相关提示词 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议在注释中添加新提示词的具体用途和使用场景,以方便其他开发者理解和维护。
| @@ -0,0 +1,71 @@ | |||
| """ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议在模块级别添加详细的文档字符串,说明该模块包含的提示词模板及其用途。
| import streamlit as st | ||
| import sys | ||
| from typing import Dict, Any, Optional | ||
| from typing import Dict, Any, Optional, List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议添加类型注解以提高代码可读性和类型安全性。
| Args: | ||
| task_counter: Task counter | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议将组件拆分为更小的函数,以提高代码可维护性和可测试性。
| pass | ||
|
|
||
|
|
||
| async def handle_requirement_analysis_workflow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议添加更多的日志记录,特别是在异常处理部分,以方便调试和问题追踪。
| return {"status": "error", "message": str(e)} | ||
|
|
||
|
|
||
| async def run_requirement_analysis_agent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
发现run_requirement_analysis_agent函数在此文件中重复定义。建议移除重复的定义以避免混淆。
| def __init__(self, logger: Optional[logging.Logger] = None): | ||
| """ | ||
| Initialize requirement analysis agent | ||
| Args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释中存在拼写错误,'Design Philosophy:ß' 应为 'Design Philosophy:'。
|
⏳ MonkeyCode-AI 正在分析,请稍等片刻... |
feat: add user requirements analysis feature in chat mode
🎯 Overview
Adds intelligent requirement gathering to chat interface - AI generates targeted questions to help users provide more detailed project requirements before code generation.
✨ Key Features
🔧 Implementation
RequirementAnalysisAgentfollowing MCP Agent architecture🚀 User Flow
💡 Benefits