Spaces:
Running
on
Zero
Running
on
Zero
test
Browse files- app.py +42 -2
- example.db +0 -0
- sample.html +11 -0
- teams.db +0 -0
app.py
CHANGED
@@ -137,8 +137,48 @@ CODE_INTERPRETER_SYSTEM_PROMPT = (
|
|
137 |
"You are capable of almost *any* task, but you can't run code that show *UI* from a python file "
|
138 |
"so that's why you always review the code in the file, you're told to run. \n"
|
139 |
)
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
def format_response(chunk, full_response):
|
144 |
# Message
|
|
|
137 |
"You are capable of almost *any* task, but you can't run code that show *UI* from a python file "
|
138 |
"so that's why you always review the code in the file, you're told to run. \n"
|
139 |
)
|
140 |
+
PRMPT2 = """
|
141 |
+
You will get instructions for code to write.
|
142 |
+
You will write a very long answer. Make sure that every detail of the architecture is, in the end, implemented as code.
|
143 |
+
Make sure that every detail of the architecture is, in the end, implemented as code.
|
144 |
+
|
145 |
+
Think step by step and reason yourself to the right decisions to make sure we get it right.
|
146 |
+
You will first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose.
|
147 |
+
|
148 |
+
Then you will output the content of each file including ALL code.
|
149 |
+
Each file must strictly follow a markdown code block format, where the following tokens must be replaced such that
|
150 |
+
FILENAME is the lowercase file name including the file extension,
|
151 |
+
LANG is the markup code block language for the code's language, and CODE is the code:
|
152 |
+
|
153 |
+
FILENAME
|
154 |
+
```LANG
|
155 |
+
CODE
|
156 |
+
```
|
157 |
+
|
158 |
+
You will start with the \"entrypoint\" file, then go to the ones that are imported by that file, and so on.
|
159 |
+
Please note that the code should be fully functional. No placeholders.
|
160 |
+
|
161 |
+
Follow a language and framework appropriate best practice file naming convention.
|
162 |
+
Make sure that files contain all imports, types etc. Make sure that code in different files are compatible with each other.
|
163 |
+
Ensure to implement all code, if you are unsure, write a plausible implementation.
|
164 |
+
Include module dependency or package manager dependency definition file.
|
165 |
+
Before you finish, double check that all parts of the architecture is present in the files.
|
166 |
+
|
167 |
+
Useful to know:
|
168 |
+
You almost always put different classes in different files.
|
169 |
+
For Python, you always create an appropriate requirements.txt file.
|
170 |
+
For NodeJS, you always create an appropriate package.json file.
|
171 |
+
You always add a comment briefly describing the purpose of the function definition.
|
172 |
+
You try to add comments explaining very complex bits of logic.
|
173 |
+
You always follow the best practices for the requested languages in terms of describing the code written as a defined
|
174 |
+
package/project.
|
175 |
+
|
176 |
+
|
177 |
+
Python toolbelt preferences:
|
178 |
+
- pytest
|
179 |
+
- dataclasses"""
|
180 |
+
|
181 |
+
interpreter.system_message += PRMPT2#CODE_INTERPRETER_SYSTEM_PROMPT
|
182 |
|
183 |
def format_response(chunk, full_response):
|
184 |
# Message
|
example.db
ADDED
Binary file (20.5 kB). View file
|
|
sample.html
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<title>My First HTML Sample</title>
|
6 |
+
</head>
|
7 |
+
<body>
|
8 |
+
<h1>Welcome to my first HTML sample!</h1>
|
9 |
+
<p>This is a paragraph of text.</p>
|
10 |
+
</body>
|
11 |
+
</html>
|
teams.db
ADDED
Binary file (16.4 kB). View file
|
|