使用手册:User Guide:CodeGeeX是什么?What's CodeGeeX?CodeGeeX是智谱AI旗下的一款基于大模型的智能编程助手,它可以实现代码的生成与补全,自动为代码添加注释,不同编程语言的代码间实现互译,针对技术和代码问题的智能问答,当然还包括代码解释,生成单元测试,实现代码审查,修复代码bug等非常丰富的功能。 CodeGeeX is an AI-based coding assistant. It is powered by a large-scale multilingual code generation model, lots of features including generates and completes code, automatically adds comments, translates code between different programming languages, provides intelligent answers to technical and code-related questions, code explanation, unit test generation, code review, bug fixing and so on. 你可以用CodeGeeX来做什么?What can you do with CodeGeeX?自动生成代码 Automated Code Generation在编码过程中,CodeGeeX可以根据上下文代码的内容,推理出接下来可能的代码输入。如果认为推理出的代码内容合适,使用快捷键Tab对生成的代码进行采纳,被采纳的代码即会高亮显示并留存在光标后;如果认为内容不合适,任意键可以取消推荐的内容,继续手动编码。 CodeGeeX provides autocomplete-style suggestions when you coding. You can receive suggestions with the “Tab” key, either by starting to write the code you want to use. 根据注释生成代码 Convert comments to codeCodeGeeX可以针对一段自然语言的注释内容,生成相关的代码片段 。特别是对于能够使用一句话描述清楚的、常见的算法片段、函数段、方法段等。 CodeGeeX can gengrate code by writing a natural language comment describing what you want the code to do. Especially for common algorithmic segments, function blocks, or method sections that can be described in a single sentence. 自动为代码添加注释 Automatically adding comments to codeCodeGeeX可以轻松为代码添加中(英)文注释。 在编辑器中选中代码,点击鼠标右键。在右键菜单中点击“CodeGeeX” ,然后点击下一级菜单“生成注释”即可。 CodeGeeX can automatically adds comments to code in both Chinese and English. Select the code in the editor, right-click your mouse. From the right-click menu, select "CodeGeeX", then click on the submenu "Add Comment" to generate the comment. 生成单元测试 Create unit testsCodeGeeX可以针对一段函数( 方法), 生成其对应的单元测试代码。 在编辑器中选中代码,点击鼠标右键。在右键菜单中点击“CodeGeeX” ,然后点击下一级菜单“生成单测”即可。也可以通过侧边栏的对话框,输入“/test”,生成其对应的单元测试代码。
An important use case of CodeGeeX is to take some of the drudgery out of writing unit tests. Select the code in the editor, right-click your mouse. From the right-click menu, select "CodeGeeX", then click on the submenu "unit tests" to generate the comment. 智能问答 Ask CodeGeeXCodeGeeX的智能问答支持模型选择,你可以选择Pro版模型或者Lite版的模型 Ask CodeGeeX supports model selection. You can choose between the Pro version model or the Lite version model. 点击CodeGeeX插件图标,打开 CodeGeeX 侧边栏,点击侧边栏上方的“Ask CodeGeeX”标签, 即可进入问答模式。 Click on the CodeGeeX plugin icon to open the CodeGeeX sidebar. Then, click on the "Ask CodeGeeX" tab at the top of the sidebar to use. 也可以在编辑器中选中代码,通过鼠标点击右键,选择“CodeGeeX”,在下级菜单中选择“向CodeGeeX提问”打开侧边栏。 You can also select code in the editor, right-click with your mouse, choose "CodeGeeX," and then select "Ask CodeGeeX" from the submenu to open the sidebar. 在侧边栏的智能问答输入框中用“/”调出预置命令:
行内对话编程 Inline ChatInLine Chat是一种通过在代码中嵌入对话,与智能编程助手CodeGeeX进行交互的方式。你可以使用“Command + i(Mac)或者 Ctrl+Alt+i (Windows)”的快捷键触发InLine Chat功能。 InLine Chat is a feature that enables real-time conversations embedded within the code to accomplish programming tasks. You can trigger the InLine Chat feature using the shortcut "Command + i" (Mac) or "Ctrl+Alt+i" (Windows). @Repo 针对开源代码仓库的智能问答 RAG用@Repo 功能对开源代码仓库进行提问,模型会根据检索到的相关背景知识生成回答,大幅减轻生成内容的幻觉性。 开源代码库的检索增强生成功能,目前已经支持超过100+个热门开源代码仓库,用户也可以自行提交希望支持的开源项目。 The @Repo feature allows users to ask questions about open-source code repositories.The enhanced search capability for open-source code repositories supports over 100+ popular repositories, and users can also submit their desired open-source projects for support. 代码解释 Explain Code代码解释是开发者非常喜爱的功能之一,CodeGeeX设置了多个入口,在编程过程中可以更加便利的使用。 Code explanation is one of the most favorite features for developers,and CodeGeeX has multiple entry points for convenient use during programming. 在编辑框中选中需要解释的代码,这时代码也会在侧边栏AskCodeGeeX的对话框中出现,同时会出现“”的蓝色提示,点击就可以获得代码的解释。 在输入框中使用预制命令“/explain”,或者在输入框中用自然语言交互的方式获得代码解释; 也可以选中代码,点击悬浮的灯泡,选择“使用CodeGeeX解释”。还可以点击鼠标右键,选择“CodeGeeX”,在下级菜单中选择“解释代码”来使用。 预测候选问题 Generate Candidate QuestionsCodeGeeX不仅支持预测代码,还支持技术问题的预测。 在智能问答Ask CodeGeeX中,当用户提出一个问题获得回复后,会继续生成接下来的候选问题。这些推荐给用户的候选问题,是和用户提出的问题相关性很强或者更进一步的问题预测。 After users pose a question and receive a response, CodeGeeX continues to generate candidate questions for the next step. These recommended candidate questions are highly relevant to the user's initial query or are further predictions of related inquiries. 代码审查 Code ReviewCodeGeeX提供的Code Review功能,用户可以从源代码文件中,选择任意被修改的文件,然后使用CodeGeeX的代码变更审查。可以直观看出代码修改的部分。也可以看到智能编程助手给代码的优化建议。 Select any modified file and conduct a code change review. This allows for a clear view of the modified code sections and provides optimization suggestions from CodeGeeX. 工具箱 Code Interpreter支持文件处理、数据分析、图表生成、图像处理; Supports file processing, data analysis, chart generation, image processing,and more. 支持的语言、框架和IDEs Supported languages, frameworks, and IDEsCodeGeeX支持100+种编程语言及开发框架,适配多种主流IDE平台,包括VSCode,JetBrains IDEs,HBuilderX,DeepIn-IDE等。 CodeGeeX supports 100+ programming languages and development frameworks, compatible with various mainstream IDE platforms, including VSCode, JetBrains IDEs, HBuilderX, DeepIn-IDE, and more.
支持语言的完整列表:https://github.com/THUDM/CodeGeeX2/blob/main/evaluation/utils.py#L14 即刻开始免费使用CodeGeeX Get started now!Free!CodeGeeX在主流IDE平台,以插件产品的形态提供给所有开发者免费使用。 CodeGeeX is available for free to all developers as a plugin product on your IDEs. 在 VSCode 和 JetBrains IDEs 、HBuilderX、Open VSX插件市场搜索“CodeGeeX”即可; 前往官网获取更多信息 Go to the Official WebSite For More Information帮助与反馈 Help & Feedback微信公众号&用户群 官方邮箱:codegeex@zhipuai.cn 提交反馈 |