Spaces:
Runtime error
Runtime error
Gregor Adams
commited on
Commit
•
6be1f45
1
Parent(s):
745163e
feat: add fat button for run (#2)
Browse files- src/pages/index.tsx +9 -9
- src/services/api/index.ts +3 -2
src/pages/index.tsx
CHANGED
@@ -36,6 +36,7 @@ import CssBaseline from "@mui/material/CssBaseline";
|
|
36 |
import Slider from "@mui/material/Slider";
|
37 |
import { useAtom } from "jotai";
|
38 |
import { atomWithStorage } from "jotai/utils";
|
|
|
39 |
|
40 |
const base = {
|
41 |
default: `/** CHANGELOG
|
@@ -174,20 +175,19 @@ export default function Home() {
|
|
174 |
>
|
175 |
<AppBar position="static" elevation={0}>
|
176 |
<Toolbar>
|
177 |
-
<
|
178 |
type="submit"
|
179 |
-
edge="start"
|
180 |
-
color="inherit"
|
181 |
aria-label={loading ? "Loading" : "Run"}
|
182 |
aria-disabled={loading}
|
183 |
disabled={loading}
|
|
|
|
|
|
|
184 |
>
|
185 |
-
|
186 |
-
</
|
187 |
-
<Typography sx={{ flex: 1 }}>
|
188 |
-
{
|
189 |
-
? "Loading …"
|
190 |
-
: `${current?.task} - ${current?.id ?? ""}`}
|
191 |
</Typography>
|
192 |
<IconButton
|
193 |
edge="end"
|
|
|
36 |
import Slider from "@mui/material/Slider";
|
37 |
import { useAtom } from "jotai";
|
38 |
import { atomWithStorage } from "jotai/utils";
|
39 |
+
import Button from "@mui/material/Button";
|
40 |
|
41 |
const base = {
|
42 |
default: `/** CHANGELOG
|
|
|
175 |
>
|
176 |
<AppBar position="static" elevation={0}>
|
177 |
<Toolbar>
|
178 |
+
<Button
|
179 |
type="submit"
|
|
|
|
|
180 |
aria-label={loading ? "Loading" : "Run"}
|
181 |
aria-disabled={loading}
|
182 |
disabled={loading}
|
183 |
+
startIcon={
|
184 |
+
loading ? <CircularProgress size={24} /> : <PlayArrowIcon />
|
185 |
+
}
|
186 |
>
|
187 |
+
Run
|
188 |
+
</Button>
|
189 |
+
<Typography sx={{ flex: 1, pl: 1 }}>
|
190 |
+
{current?.task} - ${current?.id ?? ""}
|
|
|
|
|
191 |
</Typography>
|
192 |
<IconButton
|
193 |
edge="end"
|
src/services/api/index.ts
CHANGED
@@ -41,7 +41,7 @@ export async function toOpenAI({
|
|
41 |
ADD: ${prompt_}
|
42 |
${negativePrompt_ ? `REMOVE: ${negativePrompt_}` : ""}
|
43 |
INPUT: ${template.trim()}
|
44 |
-
OUTPUT FORMAT:
|
45 |
`,
|
46 |
};
|
47 |
const task = `${prompt_}${negativePrompt_ ? ` | not(${negativePrompt_})` : ""}`;
|
@@ -60,12 +60,13 @@ You strictly follow all "DOCS".
|
|
60 |
You extend "CHANGELOG" and the CODE.
|
61 |
You ALWAYS follow the "ADD", "REMOVE", "INPUT" and "OUTPUT FORMAT".
|
62 |
You NEVER explain anything.
|
|
|
63 |
|
64 |
DOCS:
|
65 |
"ADD" is a set of features that You write code for
|
66 |
"REMOVE" is a set of things that should be removed or changed to something else
|
67 |
"INPUT" is the code that should be EXTENDED, ADJUSTED or FIXED
|
68 |
-
"OUTPUT FORMAT" is always JavaScript. the output should always be just JavaScript and NOTHING ELSE
|
69 |
|
70 |
You EXCLUSIVELY answer in the requested "OUTPUT FORMAT" and NOTHING ELSE
|
71 |
`,
|
|
|
41 |
ADD: ${prompt_}
|
42 |
${negativePrompt_ ? `REMOVE: ${negativePrompt_}` : ""}
|
43 |
INPUT: ${template.trim()}
|
44 |
+
OUTPUT FORMAT: pure valid JavaScript
|
45 |
`,
|
46 |
};
|
47 |
const task = `${prompt_}${negativePrompt_ ? ` | not(${negativePrompt_})` : ""}`;
|
|
|
60 |
You extend "CHANGELOG" and the CODE.
|
61 |
You ALWAYS follow the "ADD", "REMOVE", "INPUT" and "OUTPUT FORMAT".
|
62 |
You NEVER explain anything.
|
63 |
+
You NEVER add KEYWORDS to the OUTPUT
|
64 |
|
65 |
DOCS:
|
66 |
"ADD" is a set of features that You write code for
|
67 |
"REMOVE" is a set of things that should be removed or changed to something else
|
68 |
"INPUT" is the code that should be EXTENDED, ADJUSTED or FIXED
|
69 |
+
"OUTPUT FORMAT" is always pure valid JavaScript. the output should always be just JavaScript and NOTHING ELSE
|
70 |
|
71 |
You EXCLUSIVELY answer in the requested "OUTPUT FORMAT" and NOTHING ELSE
|
72 |
`,
|