| 1 | """ _________ _____ _____ |
| 2 | __ ____/______ _______ __ /____(_)_______ ____ _______ |
| 3 | _ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \ |
| 4 | / /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/ |
| 5 | \____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/ |
| 6 | |
| 7 | Autocomplete, Edit, Chat, and Agent tutorial |
| 8 | """ |
| 9 | |
| 10 | |
| 11 | # ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— # |
| 12 | # Autocomplete provides inline code suggestions as you type. |
| 13 | |
| 14 | # 1. Place cursor after `sorting_algorithm:` below and press [Enter] |
| 15 | # 2. Press [Tab] to accept the Autocomplete suggestion |
| 16 | |
| 17 | # Basic assertion for sorting_algorithm: |
| 18 | |
| 19 | # ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— # |
| 20 | # Edit is a convenient way to make quick changes to specific code and files. |
| 21 | |
| 22 | # 1. Highlight the code below |
| 23 | # 2. Press [Cmd/Ctrl + I] to Edit |
| 24 | # 3. Try asking Continue to "make this more readable" |
| 25 | def sorting_algorithm(x): |
| 26 | for i in range(len(x)): |
| 27 | for j in range(len(x) - 1): |
| 28 | if x[j] > x[j + 1]: |
| 29 | x[j], x[j + 1] = x[j + 1], x[j] |
| 30 | return x |
| 31 | |
| 32 | # ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— # |
| 33 | # Chat makes it easy to ask for help from an LLM without needing to leave the IDE. |
| 34 | |
| 35 | # 1. Highlight the code below |
| 36 | # 2. Press [Cmd/Ctrl + L] to add to Chat |
| 37 | # 3. Try asking Continue "what sorting algorithm is this?" |
| 38 | def sorting_algorithm2(x): |
| 39 | for i in range(len(x)): |
| 40 | for j in range(len(x) - 1): |
| 41 | if x[j] > x[j + 1]: |
| 42 | x[j], x[j + 1] = x[j + 1], x[j] |
| 43 | return x |
| 44 | |
| 45 | # ————————————————————————————————————————————————— Agent ————————————————————————————————————————————————— # |
| 46 | # Agent equips the Chat model with the tools needed to handle a wide range of coding tasks, allowing |
| 47 | # the model to make decisions and save you the work of manually finding context and performing actions. |
| 48 | |
| 49 | # 1. Switch from "Chat" to "Agent" mode using the dropdown in the bottom left of the input box |
| 50 | # 2. Use the "/init" slash command to generate a CONTINUE.md file |
| 51 | |
| 52 | # —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— # |