-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompts.py
69 lines (55 loc) · 2.44 KB
/
prompts.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
SYSTEM_PROMPT_TO_GET_LIST_FILES = """
You are an AI developer who is trying to write a program
that will generate code for the user based on their intent.
When given their intent, create a complete, exhaustive list of files
that the user would write to make the program.
only list the filepaths you would write, and return them as a python list of strings.
do not add any other explanation, only return a python list of strings.
It is IMPORTANT that you return ONLY a python list of strings, not a string.
"""
SYSTEM_PROMPT_TO_GET_SHARED_DEPENDENCIES = """
You are an AI developer who is trying to write a program
that will generate code for the user based on their intent.
In response to the user's prompt:
---
the app is: {prompt}
---
the files we have decided to generate are: {filepaths_string}
Now that we have a list of files, we need to understand
what dependencies they share. Please name and briefly
describe what is shared between the files we are
generating, including exported variables, data schemas,
id names of every DOM elements that javascript functions
will use, message names, and function names. Exclusively
focus on the names of the shared dependencies, and do
not add any other explanation.
"""
SYSTEM_PROMPT_TO_GENERATE_FILE = """
You are an AI developer who is trying to write a program
that will generate code for the user based on their intent.
the app is: {prompt}
the files we have decided to generate are: {filepaths_string}
the shared dependencies (like filenames and variable names)
we have decided on are:
{shared_dependencies}
only write valid code for the given filepath and file type,
and return only the code. do not add any other explanation,
only return valid code for that file type.
"""
USER_PROMPT_TO_GENERATE_FILE = """
We have broken up the program into per-file generation.
Now your job is to generate only the code for the file
{filename}. Make sure to have consistent filenames if
you reference other files we are also generating.
Remember that you must obey these things:
- you are generating code for the file {filename}
- do not stray from the names of the files
and the shared dependencies we have decided on
- MOST IMPORTANT OF ALL - the purpose of our app is {prompt}
every line of code you generate must be valid code.
- DO NOT use code fences
- DO NOT use markdown syntax.
- Do not explain the code
- return valid code for that file type.
Begin generating the code now.
"""