unit-mesh / auto-dev

🧙‍AutoDev: The AI-powered coding wizard(AI 驱动编程助手) with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic Auto Dev/Testing/Document/Agent feature 🧪 included! 🚀
https://ide.unitmesh.cc/
Mozilla Public License 2.0
2.76k stars 317 forks source link

feat: 增加新特性,可以正则过滤编辑器选中的内容,提问内容更加精简,明确 #174

Closed c913168497 closed 5 months ago

c913168497 commented 5 months ago

需求开发背景:我有一个提示词模板,但是相关的代码,在整个代码文件中,存在于多处,我不希望把所有的代码都一并上传,让大模型进行分析,那样提供的信息太多太杂,大模型分析的结果往往会受到干扰,生成的结果并不完美,因此我想考虑在选中内容时,有一个正则工具对提问的选择内容进行提前筛洗。 特性功能:在AutoDev的Custome Engine Prompt(Json) 中,属性:prompts 属性中, 增加属性:selectedRegex, 此属性表示标准正则表达式内容,用于在将选中的编辑器内容,进行正则匹配,将匹配的内容,筛选出来,如果有多个匹配符合,则会用 \n 隔开, 最后将匹配的内容,给予至模型调用方法