diff --git a/docs/ai.md b/docs/ai.md index e760c05fcb..273a1e9f1c 100644 --- a/docs/ai.md +++ b/docs/ai.md @@ -1,37 +1,36 @@ AI Tools ======== -Remix has integrated two AI tools: -- ChatGPT -- Remix's Solidity Copilot which uses our own LLM (large language model) called Solcoder. +Remix has its own AI tool named **RemixAI** and a sub-project called **RemixAI Copilot** for code completion. -## Remix's Solidity Copilot -Solidity Copilot helps in writing code using code completion. The switch to activate Solidity Copilot is at the top of the Editor. +RemixAI is also used in the: +- **Explain this contract** icon at the top of the Editor +- **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 -![](images/a-ai-switch.png) +## 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. -The Solidity Copilot is specifically for help with Solidity coding. Although it is thousands of times smaller than ChatGPT, it could be slower than ChatGPT. +The switch to activate it is at the top of the Editor. -## ChatGPT in Remix -Remix is currently using ChatGPT v3.5. +![](images/a-ai-switch.png) -## Editor: Right-click Menu -Both ChatGPT and Solidity Copilot are integrated into the Editor's Right-click popup menu. +All other RemixAI tools are always on. +## Editor: Right-click Menu ![](images/a-ai-editor-popup-menu.png) -In both cases the answer will be printed out in Remix's Terminal. +For both **Explain this function** or **Explain this code**, the answer will be printed out in Remix's Terminal. -### GPT: Explain a Function and Generate Documentation +### Explain a Function and Generate Documentation In the Right-click menu, select the options **Explain the function** and **Generate documentation**. -### Solcoder: Explain this code -The "Explain this code" option in the Editor's Right-click menu can be triggered with, or without, highlighting a block of code. +### Explain this code +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 -With the Solidity Copilot switch on, just start typing. When you put a space after a word, the Copilot will make a suggestion. - -**NOTE: the suggestion will take into account everything that preceded it in this contract.** +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) @@ -40,7 +39,7 @@ Hit tab to accept the suggestion. ![](images/a-ai-completion-accepted.png) -## Editor: Ask Solidity Copilot with /// +## Editor: Ask RemixAI with /// In the Editor, when the Solidity Copilot is on, you can ask it a coding question with the `///` prompt. For example: @@ -48,16 +47,15 @@ For example: /// write a function that returns an array with 3 elements from the function's parameters ``` -## Terminal Queries to AI +## Terminal Queries using RemixAI +Before your question, either type `gpt` or `sol-gpt`. -### ChatGPT Query Example -`gpt In Solidity what is the goal of modifiers?` +For example: -### Solcoder Queries `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 ChatGPT". +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) diff --git a/docs/images/a-ai-switch.png b/docs/images/a-ai-switch.png index f997b67c44..07079c289a 100644 Binary files a/docs/images/a-ai-switch.png and b/docs/images/a-ai-switch.png differ