Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 35 additions & 33 deletions docs/ai.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,63 @@
# AI Tools

Remix has its own AI tool named **RemixAI** and a sub-project called **RemixAI Copilot** for code completion.
Remix has its own AI tool named **RemixAI** and a sub-project called **RemixAI Copilot** for code completion. When you load Remix, the RemixAI Assistant appears in the Right Side Panel.

![RemixAI Assistant Right Side Panel.](images/ai/remixai-right-panel.png)

RemixAI is also used in the:

- **Explain this contract** icon at the top of the Editor
- **Explain contract** icon at the button of the Main Panel when a .sol file is active.
- **Explain this error** button when an error is thrown in the Solidity Compiler
- **Right-click menu options** of the Editor
- **Triple slash** (///) for prepending an AI code request in a file in the Editor

## Choosing an LLM for Code explanations

In the RemixAI Assistant, you can choose which LLM to use for Code Explanations. The default LLM is MistralAI. But just click the MistralAI button and a modal will popup where you can select Anthropic, OpenAI, or MistralAI.

![RemixAI LLM dropdown menu.](images/ai/llm-dropdown.png)

## Adding Context to the LLM

Clicking the `@Add context` button will bring up a modal where you can set the context of your request.

![RemixAI add context flow.](images/ai/remixai-add-context.png)

You can also set the context to the current Workspace while you type, by starting a request with `/w`.

## Code Completion

When you type a space or a new line, the RemixAI Copilot will propose some code. The proposed code is a technique called, **code completion**. The RemixAI Copilot's suggested code will take into account what has already been written in the file.
When you type a space or a new line, the RemixAI Assistant will propose some code. The proposed code is a technique called, **code completion**. The RemixAI Assistant's suggested code will take into account what has already been written in the file.

The switch to activate it is at the top of the Editor.
The switch to activate it is at the bottom left of the Main Panel when a file is active. Once activated, suggests code using MistralAI LLM.

![](images/a-ai-switch.png)
![Remix AI Copilot button.](images/ai/a-ai-switch.png)

All other RemixAI tools are always on.

## Editor: Right-click Menu

![](images/a-ai-editor-popup-menu.png)
When you load Remix, the RemixAI Assistant appears in the Right Side Panel.

For both **Explain this function** or **Explain this code**, the answer will be printed out in Remix's Terminal.
## Editor: Right-click Menu

### Explain a Function and Generate Documentation
When you right-click a function, a popup menu appears with some options executed by the RemixAI. They include, **Explain this function**, **Explain this code**, and **Generate documentation**.

In the Right-click menu, select the options **Explain the function** and **Generate documentation**.
![Remix AI right click menu.](images/ai/a-ai-editor-popup-menu.png)

### Explain this code
```{note}
For both **Explain this function** or **Explain this code**, the answer will be printed out in Remix's Terminal.
```

The "Explain this code" option in the Editor's Right-click menu can be triggered with, or without, highlighting a block of code. If some code has not been highlighted, RemixAI will take into account the code surrounding the cursor.

## Editor: Code Completion

As explained above, with the RemixAI Copilot switched on, when you put a space after a word or make a new line, the Copilot will make a suggestion.

![](images/a-ai-completion-proposal.png)
![RemixAI completion proposal.](images/ai/a-ai-completion-proposal.png)

Hit tab to accept the suggestion.

![](images/a-ai-completion-accepted.png)
![RemixAI accepted completion.](images/ai/a-ai-completion-accepted.png)

## Editor: Ask RemixAI with ///

Expand All @@ -58,26 +74,12 @@ Before your question, either type `gpt` or `sol-gpt`.

For example:

`sol-gpt What is the goal of modifiers?`
```text
sol-gpt What is the goal of modifiers?
```

## Compilers: Explain Error

In the compiler error "cards" of both the Solidity compiler and the Vyper compiler there is a button to "Ask RemixAI".

![](images/a-ai-solcomp1.png)

## Solidity Copilot Settings

![](images/a-ai-settings.png)

The settings for Solidity Copilot are in Remix's Settings panel. These settings are primarily for the code completion functions.

There are two settings for Solidity Copilot:

### Maximum words

Max words sets the maximum number of words that will be returned. The fewer the words, the more likely that a context-accurate answer will be returned and the quicker the response time.

### Temperature
In the compiler error "cards" of both the Solidity Compiler and the Vyper compiler there is a button to "Ask RemixAI".

Temperature is an advanced setting. As the setting is increased, the range of possible answers will increase. A higher number is more likely to return a relevant answer.
![Compiler Explain Error](images/ai/a-ai-solcomp1.png)
2 changes: 0 additions & 2 deletions docs/file_explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Remixd is an NPM package that allows you to share a specified folder on your com

Remix Desktop is a version of the Remix IDE that exists as a native app on your computer instead of a browser app. Since it's a native app on your computer, the files are saved directly to your hard drive.

Note that when using Remix Desktop, you cannot use a browser wallet like MetaMask, because Remix Desktop does not run in a browser. To connect to public networks, you need to use service like [Infura](https://www.infura.io/) and then use the WalletConnect plugin to approve transactions on your mobile device.

### Connecting Remix to remote Git repositories

Remix IDE supports version control with version control platforms like GitHub (or similar like GitLab) and in the InterPlanetary File System (IPFS), allowing you to store the code you write on remote repositories.
Expand Down
Binary file removed docs/images/a-ai-editor-popup-menu.png
Binary file not shown.
Binary file removed docs/images/a-ai-switch.png
Binary file not shown.
Binary file added docs/images/ai/a-ai-editor-popup-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added docs/images/ai/a-ai-switch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ai/llm-dropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ai/remixai-add-context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ai/remixai-right-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.