feat: add user requirements analysis feature#31
Merged
Zongwei9888 merged 4 commits intomainfrom Feb 3, 2026
Merged
Conversation
added 2 commits
August 27, 2025 22:52
…dition + simplified questions generated
|
@MonkeyCode-AI review this pr plz |
MonkeyCode-AI
left a comment
There was a problem hiding this comment.
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.
建议在注释中添加新提示词的具体用途和使用场景,以方便其他开发者理解和维护。
| @@ -0,0 +1,71 @@ | |||
| """ | |||
There was a problem hiding this comment.
建议在模块级别添加详细的文档字符串,说明该模块包含的提示词模板及其用途。
ui/components.py
Outdated
| import streamlit as st | ||
| import sys | ||
| from typing import Dict, Any, Optional | ||
| from typing import Dict, Any, Optional, List |
ui/components.py
Outdated
|
|
||
| Args: | ||
| task_counter: Task counter | ||
|
|
| pass | ||
|
|
||
|
|
||
| async def handle_requirement_analysis_workflow( |
There was a problem hiding this comment.
建议添加更多的日志记录,特别是在异常处理部分,以方便调试和问题追踪。
| return {"status": "error", "message": str(e)} | ||
|
|
||
|
|
||
| async def run_requirement_analysis_agent( |
There was a problem hiding this comment.
发现run_requirement_analysis_agent函数在此文件中重复定义。建议移除重复的定义以避免混淆。
| def __init__(self, logger: Optional[logging.Logger] = None): | ||
| """ | ||
| Initialize requirement analysis agent | ||
| Args: |
There was a problem hiding this comment.
注释中存在拼写错误,'Design Philosophy:ß' 应为 'Design Philosophy:'。
|
⏳ MonkeyCode-AI 正在分析,请稍等片刻... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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