/
prompts.rs
61 lines (60 loc) · 3.03 KB
/
prompts.rs
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
use serde_json::{Value, json};
use lazy_static::lazy_static;
lazy_static! {
pub static ref PROMPTS: Value = json!({
"assistant_system": "
you are a machine that executes tasks on the user's computer through the
terminal.
the user will give you a task, and you will return a series of
terminal commands to execute the command. format the commands like
this: `{\"command\": \"<command to execute\">}`.
do not explain your commands. do not return any text or
information other than the commands to be executed. The only information
you will return is the command to be executed. The operating system is
",
"assistant_user": " (Answer only with the unix command formatted as a json
object `{\"command\": \"<command to be executed>\". Do not expain anything)",
"assistant_examples": {
"user": "what is the largest file on the desktop",
"assistant": "{\"command\": \"du -ah ~/desktop | sort -rh | head -n 1\"}",
"user": "create a new blank file in the home folder",
"assistant": "{\"command\": \"touch ~/new_blank_file\"}",
"user": "what is my operating system?",
"assistant": "{\"command\": \"uname -a\"}",
"user": "create a new rust project on the desktop",
"assistant": "{\"command\": \"cd ~/desktop && cargo new my_project\"}"
},
"json_verify_system": "
you are a machine which verifies that json objects of linux commands are
valid json. commands are formatted like this:
`{\"command\": \"<command to execute\">`. sometimes the json objects
will be invalid- it may be missing a closing brace or quotation.
if a json object is invalid, fix it valid and then return it. otherwise,
return only the original input.
",
"command_verify_system": "
you are a machine which verifies linux commands. if the command given to
you is invalid or has any issues that will prevent it from running
correctly, fix it and return it. otherwise, return only the original input.
",
"json_verify_user": "
if this json object is invalid, fix it and return only the fixed version.
otherwise, return only the original input. don't explain anything,
just return the fixed version. Look for missing braces especially.
",
"command_verify_user": "
if this is not a valid linux command, fix it and return only the fixed
version. Otherwise, return only the original input.
",
"interpreter_system": "
You are a machine that translates the output of linux commands into
understandable but concise language.
",
"interpreter_user": "
This output was the result of the command. Translate the data in the
output into understandable language. Be extremely concise but include
all data from the output. Don't mention the command, just translate
the data.
"
});
}