Skip to content

Commit

Permalink
Update ai.md
Browse files Browse the repository at this point in the history
Edits to ai.md Update
  • Loading branch information
vermouth22 authored Apr 8, 2024
1 parent f74a766 commit 70a3a68
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ Remix has integrated two AI tools:
- Solidity Copilot which uses our own LLM (large language model) called Solcoder.

## Remix's Solidity Copilot
Solidity Copilot, is to aid writing code with code completion. The switch to turn on Solidity Copilot is at the top of the Editor.
Solidity Copilot helps in writing code using code completion. The switch to activate Solidity Copilot is at the top of the Editor.

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

The Solidity Copilot is specifically for help with Solidity coding. While it is thousands of times smaller than ChatGPT, it will likely be slower than ChapGPT.
The Solidity Copilot is specifically for help with Solidity coding. Although it is thousands of times smaller than ChatGPT, it will likely be slower than ChatGPT.

## ChatGPT in Remix
Remix is currently using ChatGPT v3.5.

## Editor: Right-Click Menu
Both ChatGPT and Solidity Copilot are integrated into the editor's Right-Click popup menu.
## Editor: Right-click Menu
Both ChatGPT and Solidity Copilot are integrated into the Editor's Right-click popup menu.

![](images/a-ai-editor-popup-menu.png)

In both cases the answer will be printed out in Remix's terminal.
In both cases the answer will be printed out in Remix's Terminal.

### GPT: Explain a function & generate documentation
In the Right-click menu, the options **Explain the function** and **Generate documentation**.
### GPT: 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 code.
The "Explain this code" option in the Editor's Right-click menu can be triggered with, or without, highlighting a block of code.

## Editor: Code Completion
With the Soldity Copilot switch on, just start typing. When you put a space after a word, the Copilot will make a suggestion.
With the Soldity 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 came before in this contract.**
**NOTE: the suggestion will take into account everything that preceded it in this contract.**

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

Expand All @@ -41,36 +41,36 @@ Hit tab to accept the suggestion.


## Editor: Ask Solidity Copilot with ///
In the Editor, when the Solidity Copilot is on, you can ask it coding question with the `///` prompt.
In the Editor, when the Solidity Copilot is on, you can ask it a coding question with the `///` prompt.
For example:

```
/// write a function that returns an array with 3 elements that are from the function's parameters
/// write a function that returns an array with 3 elements from the function's parameters
```

## Terminal queries to AI
## Terminal Queries to AI

### ChatGPT query example
### ChatGPT Query Example
`gpt In Solidity what is the goal of modifiers?`

### Sol Coder queries
`sol-gpt what is the goal of modifiers?`
### 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.
## Compilers: Explain Error
In the compiler error "cards" of both the Solidity compiler and the Vyper compiler there is a button to "Ask ChatGPT".

![](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.
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 words that will be returned. The fewer the words, the more likely that a useable answer will be returned.
Max words sets the maximum number of words that will be returned. The fewer the words, the more likely that a useable answer will be returned.

### Temperature
Temperature is a setting for advanced users. As the setting is raised, the range of possible answers will be wider. A lower number is more likely to return a usable answer.
Temperature is an advanced setting. As the setting is increased, the range of possible answers will increase. A lower number is more likely to return a relevant answer.

0 comments on commit 70a3a68

Please sign in to comment.