muAgent: [{#21}][{difficulty}]{场景用例:构建一个代码仓库阅读的场景}#41
Draft
XingYu-Zhong wants to merge 10 commits intocodefuse-ai:mainfrom
Draft
muAgent: [{#21}][{difficulty}]{场景用例:构建一个代码仓库阅读的场景}#41XingYu-Zhong wants to merge 10 commits intocodefuse-ai:mainfrom
XingYu-Zhong wants to merge 10 commits intocodefuse-ai:mainfrom
Conversation
This commit adds a new .env-tmp file to the repochat example. The .env-tmp file includes environment variables for the GitHub token, OpenAI API key, API base URL, model name, embed model, and model engine. Additionally, the commit introduces a new file, codebase/coderetrieval.py, which contains code for retrieving and handling codebase information. The code includes imports, initialization of configuration variables, and functions for code search. Lastly, the commit updates the requirements.txt file to include the dependencies gitpython, codefuse-muagent, and chainlit.
1. 在 coderetrieval.py 中添加创建 CB_ROOT_PATH 目录的逻辑 2. 在 prompt.py 中新增项目目录分析相关的提示模板 3. 新增 get_directory_structure 函数用于获取指定目录的文件结构 4. 添加 Person.java 示例文件
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.
To-Do List:
调研muAgent已有功能(2h)
克隆代码仓库(0.5h)
• 接收GitHub仓库地址和本地存储路径作为输入。
• 使用 git clone 命令将仓库克隆到指定路径。
• 检查克隆过程是否成功,处理可能的错误(如无效地址、网络错误等)。
解析代码结构(2h)
• 获取仓库的目录结构,包括文件和文件夹的层级关系。
• 统计总文件数量、文件夹数量。
• 识别关键文件类型(如 .py, .js, README.md 等),并判断是否存在典型的启动文件(如 main.py, index.js 等)。
生成初始信息(6h)
• 仓库描述:读取 README.md 或其他说明文件,提取仓库的主要功能和描述信息。
• 文件夹描述:为每个文件夹生成基本描述,使用自然语言描述文件夹的可能作用(如代码、配置、测试等)。
• 启动文件:根据命名惯例和文件内容(例如包含 main、app 或 index 的文件),识别可能的启动文件。
• 启动指导:生成基本的启动指导(如“运行 python main.py” 或 “执行 npm start”等)。
构建图数据库(调研后定)
• 确定图数据库的结构(例如,节点代表文件或文件夹,边表示包含关系或引用关系)。
• 将仓库的目录结构转换为图数据库模型。
• 为每个文件夹和文件创建节点,并添加描述信息、文件类型等属性。
• 创建包含关系的边,链接文件夹与其包含的文件。
问答模块的实现(3h)
• 提供一个问答接口,允许用户查询关于仓库的基本信息。
• 支持多个tools,以便在详细问题上查询tools来回答。
• 构建web页面集成前面的功能,提供问答窗口。