# 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="https://3745657014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYy-lqJKjq1m0yBAX4r%2Fuploads%2Fg6xIL1pTjdTrQ3GLm3Ej%2Fimage.png?alt=media&#x26;token=829c8629-759e-492f-9776-9d0baef3cff4" 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="https://3745657014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYy-lqJKjq1m0yBAX4r%2Fuploads%2FOxHNd6exyX976x181Otc%2Fimage.png?alt=media&#x26;token=6f3292fe-8ff0-4041-80e3-2ba2b530ce6f" 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="https://3745657014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYy-lqJKjq1m0yBAX4r%2Fuploads%2FpVm7mpx6XSpHbL7EAhGK%2Fimage.png?alt=media&#x26;token=95b43f07-ea1d-4282-a504-457e2d7ec2ce" alt=""><figcaption></figcaption></figure>
