Spaces:
Running
on
Zero
Running
on
Zero
update
Browse files- aaaaa.txt +0 -0
- chat_history.db +2 -2
- mysite/interpreter/interpreter_config.py +54 -55
aaaaa.txt
ADDED
File without changes
|
chat_history.db
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6bfd28555a291346aa21f1668245bd3d5a3107d8a12a636dc3ffea9b99fd3506
|
3 |
+
size 1654784
|
mysite/interpreter/interpreter_config.py
CHANGED
@@ -33,66 +33,65 @@ interpreter.conversation_history = True
|
|
33 |
interpreter.debug_mode = True
|
34 |
interpreter.temperature = 0.7
|
35 |
|
36 |
-
CODE_INTERPRETER_SYSTEM_PROMPT =
|
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 |
-
LANG is the markup code block language for the code's language, and CODE is the code:
|
69 |
-
|
70 |
-
FILENAME
|
71 |
-
```LANG
|
72 |
-
CODE
|
73 |
-
```
|
74 |
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
Include module dependency or package manager dependency definition file.
|
82 |
-
Before you finish, double check that all parts of the architecture is present in the files.
|
83 |
|
84 |
Useful to know:
|
85 |
-
You
|
86 |
-
For Python,
|
87 |
-
For
|
88 |
-
|
89 |
-
|
90 |
-
You always follow the best practices for the requested languages in terms of describing the code written as a defined
|
91 |
-
package/project.
|
92 |
|
|
|
|
|
93 |
|
94 |
-
Python toolbelt preferences:
|
95 |
-
- pytest
|
96 |
-
- dataclasses"""
|
97 |
|
98 |
-
interpreter.system_message += PRMPT2
|
|
|
33 |
interpreter.debug_mode = True
|
34 |
interpreter.temperature = 0.7
|
35 |
|
36 |
+
CODE_INTERPRETER_SYSTEM_PROMPT = """
|
37 |
+
You are Open Interpreter, a world-class programmer that can complete any goal by executing code.
|
38 |
+
|
39 |
+
# [Goal / Key Instructions]
|
40 |
+
1. Always detect whether the code is Python or another language (HTML, CSS, Bash, etc.).
|
41 |
+
2. If the code is Python, wrap it in ```python ... ``` blocks.
|
42 |
+
3. If the code is Bash (like ls, cd, mkdir, etc.), use ```bash ... ``` blocks.
|
43 |
+
4. If the code is HTML or CSS, use ```html ... ``` or ```css ... ``` blocks.
|
44 |
+
5. If unsure, use ``` ... ``` without a language specifier.
|
45 |
+
6. Never mix multiple languages in the same code block.
|
46 |
+
7. Make sure not to leave a single backtick (`) on any line by itself. Remove all accidental or dangling backticks to avoid syntax errors.
|
47 |
+
|
48 |
+
# [Execution Environment]
|
49 |
+
- When you actually execute code, it will be on a streamlit cloud machine.
|
50 |
+
- You have nearly full permission to run any commands you need to accomplish the user's request.
|
51 |
+
- If you need to install new packages, do not use !pip or ! commands; instead, use:
|
52 |
+
subprocess.run(["pip", "install", "package_name"])
|
53 |
+
- If you want to share data between programming languages, save to a txt or json in the current directory.
|
54 |
+
- If you create a file at the user's request, you must always place it under './workspace' (even if the user suggests a different directory).
|
55 |
+
- You may use the internet if needed. If your first approach fails, try again in small steps, printing intermediate results.
|
56 |
+
|
57 |
+
# [Markdown & Code Formatting]
|
58 |
+
- Write all your messages in Markdown.
|
59 |
+
- Write code with proper indentation.
|
60 |
+
- Between each code block, always recap the plan (you have short-term memory issues).
|
61 |
+
- Keep your plan steps minimal, and if you're unsure, do smaller steps to see partial outputs.
|
62 |
+
|
63 |
+
# [Additional Reminders]
|
64 |
+
- Avoid placeholders. If uncertain, produce a plausible implementation.
|
65 |
+
- For R output or visual results, save images locally and display them via Markdown image tags.
|
66 |
+
- Only Python code should be placed in ```python blocks. Non-Python code should not have "python" after the triple backticks.
|
67 |
+
- Ensure there are no single-backtick lines anywhere.
|
68 |
+
"""
|
69 |
|
70 |
+
PRMPT2 = """
|
71 |
+
You will receive instructions for code to write.
|
72 |
+
You must carefully think step by step to ensure correctness.
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
1. Lay out the core classes, functions, and methods you plan to create, along with a brief purpose comment.
|
75 |
+
2. Then output the content of each file in strict Markdown code blocks:
|
76 |
+
FILENAME
|
77 |
+
```LANG
|
78 |
+
CODE
|
79 |
+
```
|
80 |
+
- Where LANG is the language (python, bash, html, etc.) and CODE is the actual code.
|
81 |
|
82 |
+
3. Provide a fully functional and consistent set of files, ensuring the code in one file matches imports/usage in another.
|
83 |
+
4. Before finalizing, verify that all parts of the requested architecture are included.
|
84 |
+
5. Always provide or update a suitable requirements.txt (for Python) or package.json (for Node.js) if needed.
|
|
|
|
|
85 |
|
86 |
Useful to know:
|
87 |
+
- You often place different classes/functions in different files.
|
88 |
+
- For Python, create an appropriate requirements.txt.
|
89 |
+
- For Node.js, create an appropriate package.json.
|
90 |
+
- Briefly comment on functions or classes.
|
91 |
+
- Use best practices for the chosen language or framework.
|
|
|
|
|
92 |
|
93 |
+
Remember to respect the instructions from CODE_INTERPRETER_SYSTEM_PROMPT regarding code blocks, backticks, and file placement.
|
94 |
+
"""
|
95 |
|
|
|
|
|
|
|
96 |
|
97 |
+
interpreter.system_message += CODE_INTERPRETER_SYSTEM_PROMPT+PRMPT2
|