# 2.9. AI - Code Sage 模块

{% embed url="<https://www.youtube.com/watch?v=awJ2UqnljQM>" %}

## 1. 使用插件

用户右侧边栏会显示插件，点击插件即可展开插件功能菜单。

ChainIDE Code Sage 目前支持五项功能：

* Commentator：为代码添加注释。
* DeCommentator：为代码删除注释。
* Advisor：提供代码优化改进建议。
* Refactorer：识别和修复代码缺陷问题。
* Code Generator：以对话的形式生成您需要的代码。

<figure><img src="/files/W2ewQ3g5ZLUQUXZkuzVL" alt=""><figcaption></figcaption></figure>

## 2. 全局使用

用户可以**点击右侧四个按钮**，快速对**当前打开的文件中的全部代码**进行相对应的操作，如，点击按钮为智能合约提供详细的注释：

<figure><img src="/files/yv434d2qlQZaahIHHmv4" alt=""><figcaption></figcaption></figure>

## 3. 局部操作

用户也可以**选中需要操作的代码块**，**右键打开快捷操作**，用户可以选择自己想要进行的操作。

<figure><img src="/files/uoU86abWRJSwJgZgyRwX" alt=""><figcaption><p><br></p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chainide.gitbook.io/chainide-chinese/4.-chainide-quan-ti-bu-ju/2.9.-ai-code-sage-mo-kuai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
