> For the complete documentation index, see [llms.txt](https://chainide.gitbook.io/chainide-english-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chainide.gitbook.io/chainide-english-1/chainide-modules/2.9.-ai-code-sage-module.md).

# 2.9. AI - Code Sage Module

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

## 1. Using plugins

The plugins will be displayed in the sidebar on the right side for users. Clicking on a plugin will expand its functionality menu.

ChainIDE Code Sage currently supports five functions:

* Commentator: Add comments to the code.
* DeCommentator: Remove comments from the code.
* Advisor: Provide suggestions for code optimization.
* Refactorer: Identify and fix code defects.
* Code Generator: Generate the code you need in a conversational manner.

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

## 2. Global Usage

Users can click on the four buttons on the right to quickly perform the corresponding operations on all the code in the currently open file. For example, clicking a button can provide detailed comments for smart contracts.

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

## 3. Local Operations

Users can also select the code block they want to operate on, right-click to open quick actions, and choose the operation they want to perform.

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://chainide.gitbook.io/chainide-english-1/chainide-modules/2.9.-ai-code-sage-module.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
