哪个小说网站防盗做的好,seo有哪些优化工具,搜索引擎排名谷歌,最新传奇网页游戏排行榜在过去的半个月里#xff0c;我们为开源辅助编程工具 AutoDev 添加了更强大的自定义能力#xff0c;现在你可以#xff1a; 使用自己部署的开源大模型自己配置 Intellij IDEA 中的行为自定义开发过程中的规范 当然了#xff0c;如果您自身拥有开发能力的话#xff0c;建议… 在过去的半个月里我们为开源辅助编程工具 AutoDev 添加了更强大的自定义能力现在你可以 使用自己部署的开源大模型自己配置 Intellij IDEA 中的行为自定义开发过程中的规范 当然了如果您自身拥有开发能力的话建议您自己基于 AutoDev 定制。毕竟为 AutoDev 添加太多的自定义能力会导致架构的复杂性螺旋上升。 AutoDev 现在已支持多语言不同语言能力有所差异、多 IDE因此只在 JetBrains 任何一个本地 IDE 的插件市场里搜索 AutoDev 并安装 即可。 自定义大语言模型 我们通过 Thoughtworks 正在的开源底层模型平台 Gluon Meson构建了一个统一的大语言模型接口。随后我们测试了切换几个开源模型清华大学 ChatGLM2-6B、阿里云通义千问 Qwen-7B 等均可以流畅使用 —— 模型太小在诸如需要上下文补全的能力没有那么强。 考虑到提供更好的开发者体验现在的 AutoDev 只支持服务端的流式返回为此我们在源码中提供了一个 FastAPI EventSourceResponse 的示例作为参考。 请求结构 我们发送给服务端的接口将类似于 {messages: [{ role: user, message: Im Nihillum. },{ role: assistant, message: OK },{ role: user, message: What did I just say? }]
} 根据现有的 #25 issue 设计情况我们也将在未来提供更多的可配置的 headers 等 响应结果 对于结果来说为了方便支持不同的模型我们使用了 JSON Path 来处理返回结果。如下是一个简单的 JSON Path 的配置示例。 $.choices[0].content 随后将从 content 中取值并处理。 详细见 README.md 中的 Custom LLM Server 部分。 自定义 prompt 行为项 为了配合不同大模型的能力差异我们参考了 JetBrains AI Assistant 的设计也在 AutoDev 中引入了自定义行为的方式即你可以自定义自己的行为并配置 prompt 的上下文。诸如于你可以自定义一个将 Rust 转为 Kotlin 语言的行为项 为此只需要添加一个对应的 JSON 配置即可 {prompts: [{title: \uD83C\uDDE8\uD83C\uDDF3 翻译成 Kotlin,autoInvoke: false,matchRegex: .*,priority: 1000,template: Translate the following code to Kotlin.\n${SIMILAR_CHUNK}\nCompare these snippets:\n${METHOD_INPUT_OUTPUT}\nHere is the code:\n${SELECTION}}]
} 其中的 priority 是用来配置在菜单中的顺序template 则是发送给 LLM 的 prompt。除此在 template 中为了更好的支持一些高级的特征我们配置了一些上下文变量 ${SELECTION}所选代码${SIMILAR_CHUNK}相似的代码片段${METHOD_INPUT_OUTPUT}方法的输入与输出 规范变量 ${SPEC_*}从配置文件的规范部分加载规范比如 ${SPEC_controller}将会从配置中加载 spec.controller。 详细见 README.md 中的 Custom Action 部分。 自定义规范 在自定义操作项中我们会定义一些不同任务的配置规则诸如于 SPEC_controller 便会从 spec 中读取对应的内容作为配置 prompt 的一部分 {spec: {controller: - Use BeanUtils.copyProperties in the Controller for DTO to Entity conversion.\n- Avoid using Autowired.\n- Use Swagger Annotations to indicate API meanings.\n- Controller methods should capture and handle business exceptions, rather than throwing system exceptions.,service: - Service layer should use constructor injection or setter injection; avoid using the Autowired annotation.,entity: - Entity classes should use JPA annotations for database mapping.\n- The entity class name should match the corresponding database table name. Entity classes should use annotations to mark primary keys and table names, for example: Id, GeneratedValue, Table, etc.,repository: - Repository interfaces should extend the JpaRepository interface to inherit basic CRUD operations.,ddl: - Fields should be constrained with NOT NULL constraints to ensure data integrity.}
} 然后你就可以愉快地进行 AI 辅助编程了。 小结 如果大家遇到什么问题或者有什么好玩的新需求欢迎来 GitHub 讨论https://github.com/unit-mesh/auto-dev