-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassistant_ai_python.sublime-settings
94 lines (91 loc) · 2.98 KB
/
assistant_ai_python.sublime-settings
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
// Place your settings in the file "Packages/User/assistant_ai_python.sublime-settings",
// which overrides the settings in here. When opening this by Sublime Settings AssitantAI menu,
// your custom settings are in the right pane.
// This file specifies only prompts, and all them are restricted to Syntax = Python.
// The prompts here defined provides only one var (text) which makes them usable only when
// there are endpoints suitable for it (i.e.: are enabled, and requires only 'text' variable).
// One example endpoint could be OpenAI server for ChatGPT completions.
{
// add your custom prompts here
"prompts": [
// The following is a funny example of what you can do with your own prompts.
// Copy this prompt in your user's settings file, un-comment it, and test it!
// Note how this prompt imports from 'python_add_comments' but replaces some specifications.
// {
// // Importing from another prompt
// "import": "python_add_comments",
// // Replacing name, icon and description
// "name": "Add funny comments",
// "icon": "🤣",
// "description": "Add funny comments to selected ${syntax} code.",
// // The generated text now adds an instruction to get funny
// "vars": {
// "text": [
// "Comment the lines to the following ${syntax} code following theses rules:",
// "* Return only the edited ${syntax} code.",
// "* Do not alter the code.",
// "* All comments must be written in a funny style, addressed to my future me.",
// "",
// "${text}",
// ],
// },
// },
],
// prompts provided by this package
"default_prompts": [
{
"id": "python_add_docstring",
"name": "Add docstring",
"icon": "🐍",
"description": "Add docstring to selected ${syntax} function.",
"required_inputs": ["text"],
"required_syntax": ["python", "source.python"],
"vars": {
"text": [
"Add the docstring to the following ${syntax} code following theses rules:",
"* Return only the edited ${syntax} code.",
"* Do not alter the code.",
"",
"${text}",
],
},
"command": "replace",
},
{
"id": "python_add_comments",
"import": "python_add_docstring", // import previous prompt
"name": "Add comments",
"description": "Add comments to selected ${syntax} code.",
"vars": {
"text": [
"Comment the lines to the following ${syntax} code following theses rules:",
"* Return only the edited ${syntax} code.",
"* Do not alter the code.",
"",
"${text}",
],
},
},
{
"id": "python_explain_selection",
"name": "Explain selected text",
"icon": "🐍",
"description": "Explain the selected code.",
"required_inputs": ["text"],
"required_syntax": ["python", "source.python"],
"vars": {
"text": [
"Explain the following ${syntax} code following these rules:",
"* Be verbose, and explain line by line.",
"* Use Markdown syntax.",
"",
"${text}",
],
},
"command": {
"cmd": "output",
"syntax": "Markdown"
},
},
],
}