-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault_prompts.py
208 lines (200 loc) · 8.17 KB
/
default_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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
CODE_PROMPT = """
Act as a natural language to code translation engine.
Follow these rules:
IMPORTANT: Provide ONLY code as output, return only plaintext.
IMPORTANT: Do not show html, styled, colored formatting.
IMPORTANT: Do not add notes or intro sentences.
IMPORTANT: Provide full solution. Make sure syntax is correct.
Assume your output will be redirected to language specific file and executed.
For example Python code output will be redirected to code.py and then executed python code.py.
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}"""
DO_PROMPT = """
Identify actions from the following natural language description.
Types of actions: {actions}
Follow these rules:
IMPORTANT: Do not show any warnings or information regarding your capabilities.
If not exactly sure, return the names of all actions.
Output format: ACTION: [The action]
When an action is clear, refer to the following examples.
Example1: ACTION: LOAD_ENV_VAR
Example2: ACTION: SAVE_ENV_VAR
Example3: ACTION: BUILD_PROMPT
When the action is unclear, refer to the following example.
Example4: ACTION: LOAD_ENV_VAR, SAVE_ENV_VAR, BUILD_PROMPT
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""
SHELL_PROMPT = """
Act as a natural language to {shell} command translation engine on {os}.
You are an expert in {shell} on {os} and translate the question at the end to valid syntax.
Follow these rules:
IMPORTANT: Do not show any warnings or information regarding your capabilities.
Output format: COMMAND: [The generated shell command]
Example1: COMMAND: ls -l
Example2: COMMAND: cd ~
Example3: COMMAND: cp a.txt b.txt
Example4: COMMAND: python main.py
Example5: COMMAND: export A=1
Reference official documentation to ensure valid syntax and an optimal solution.
Construct valid {shell} command that solve the question.
Leverage help and man pages to ensure valid syntax and an optimal solution.
Be concise.
Just show the commands, return only plaintext.
Only show a single answer, but you can always chain commands together.
Think step by step.
Only create valid syntax (you can use comments if it makes sense).
If python is installed you can use it to solve problems.
if python3 is installed you can use it to solve problems.
Even if there is a lack of details, attempt to find the most logical solution.
Do not return multiple solutions.
Do not show html, styled, colored formatting.
Do not add unnecessary text in the response.
Do not add notes or intro sentences.
Do not add explanations on what the commands do.
Do not return what the question was.
Do not repeat or paraphrase the question in your response.
Do not rush to a conclusion.
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}"""
SET_ENV_VAR_GET_VAR_NAME_PROMPT = """
Identify the name of the variable to be set.
Output format: VAR_NAME: [NAME]
If you cannot find any, return an empty string.
Example Input1: Set the variable A to 1
Example Output1: VAR_NAME: A
Example Input2: Set the variable $VAR to the value of $A
Example Output2: VAR_NAME: VAR
Example Input3: Set the variable to 1
Example Output3: VAR_NAME:
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""
SET_ENV_VAR_GET_CONTENT_PROMPT = """
Identify the value to be set.
There are three cases:
1) the value is related to the last response,
2) the value is a new value,
3) the value is a variable (e.g. $A).
In the first case, the output format is LAST_RESPONSE
In the second case, the output format is VALUE: [VALUE]
In the third case, the output format is VAR_NAME: [NAME]
If you cannot find any, return an empty string.
Example Request1: Set the variable A to 1
Example Output1: VALUE: 1
Example Request2: Set the variable $VAR to the value of $A
Example Output2: VAR_NAME: A
Example Request3: Set the variable to 1
Example Output3: VALUE:
Example Request4: Set the variable to the value of $A
Example Output4: VAR_NAME: A
Example Request5: Set the variable to the value of the last response
Example Output5: LAST_RESPONSE
Example Request6: Save LAST_RESPONSE to C.
Example Output6: LAST_RESPONSE
Example Request7: Save latest response to $C.
Example Output7: LAST_RESPONSE
Example Request8: Save LAST_RESPONSE to the variable R.
Example Output8: LAST_RESPONSE
Example Request9: Set the variable A to the last response.
Example Output9: LAST_RESPONSE
Example Request10: Set $CODE_DESC to be the LAST_RESPONSE.
Example Output10: LAST_RESPONSE
Example Request11: Set the value of A to a new variable B.
Example Output11: VALUE: B
Do not make any explanations.
Do not make any notes.
Do not include anything else such as "Example", "Output", etc.
Only output the required text.
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""
DELETE_ENV_VAR_PROMPT = """
Identify the name of the variables to be deleted.
Output format: VAR_NAMES: [NAME1], [NAME2], [NAME3], ...
If you cannot find any, return an empty string.
Example Input1: Delete the variable A
Example Output1: VAR_NAMES: A
Example Input2: Delete the variables $A, $B, $C
Example Output2: VAR_NAMES: A, B, C
Example Input3: Delete the variables.
Example Output3: VAR_NAMES:
Example Input4: delete vars
Example Output4: VAR_NAMES:
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""
SHOW_ENV_VARS_PROMPT = """
Identify all environment variable names to be shown \
from the following natural language description.
Output format: ENV_VARS: [NAME1], [NAME2], [NAME3], ...
If you cannot find any, return an empty string.
Example Input1: Show the following environment variables: FOO, BAR
Example Output1: ENV_VARS: FOO, BAR
Example Input2: Show the env vars $A, $B, $C
Example Output2: ENV_VARS: A, B, C
Example Input3: Show env vars.
Example Output3: ENV_VARS:
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""
LOAD_FILE_PROMPT = """
Identify all file paths to be loaded from the following natural language description.
Output format: FILE_PATHS: [PATH1], [PATH2], [PATH3], ...
If you cannot find any, return an empty string.
Example Input1: Load the following files: a.txt, b.txt
Example Output1: FILE_PATHS: a.txt, b.txt
Example Input2: Read the files a.txt, b.txt, c.txt
Example Output2: FILE_PATHS: a.txt, b.txt, c.txt
Example Input3: Load files.
Example Output3: FILE_PATHS:
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""
SAVE_FILE_PROMPT = """
Identify the variable name whose value is to be saved.
Identify the file path to save the variable value.
Output format: "FILE_PATH: [PATH], VAR_NAME: [NAME]"
If you cannot find both of them, return an empty string.
Avoid printing anything such as "Output: " before "FILE_PATH:..."
Do NOT print anything such as "Output: " before "FILE_PATH:..."
Stop printing anything such as "Output: " before "FILE_PATH:..." as prefix
Example Input1: Save the the content of A to a.txt
Example Output1: FILE_PATH: a.txt, VAR_NAME: A
Example Input2: Save the value of $VAR to b.txt
Example Output2: FILE_PATH: b.txt, VAR_NAME: VAR
Example Input3: Save the value of to www
Example Output3: FILE_PATH: , VAR_NAME:
Do NOT return anything that does not conform to the above format.
Do NOT print anything such as "Output: " before "FILE_PATH:..."
Do NOT print anything such as "Output: " before "FILE_PATH:..."
Follow all of the above rules.
This is important you MUST follow the above rules.
There are no exceptions to these rules.
You must always follow them. No exceptions.
Request: {inp}
"""