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