Spaces:
Running
Running
Update llm.js
Browse files
llm.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
| 1 |
-
const lanes = {
|
| 2 |
-
control: [],
|
| 3 |
-
world: [],
|
| 4 |
-
agent: [],
|
| 5 |
-
system: []
|
| 6 |
-
};
|
| 7 |
-
|
| 8 |
export function parseCommand(text) {
|
| 9 |
const t = text.toLowerCase();
|
| 10 |
|
| 11 |
-
if (t.includes("
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
return
|
| 16 |
}
|
| 17 |
|
| 18 |
-
function
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
export function parseCommand(text) {
|
| 2 |
const t = text.toLowerCase();
|
| 3 |
|
| 4 |
+
if (t.includes("fractal")) {
|
| 5 |
+
return packet("world", { power: 8.0 });
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
if (t.includes("stronger")) {
|
| 9 |
+
return packet("world", { power: 12.0 });
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
if (t.includes("reset")) {
|
| 13 |
+
return packet("system", { reset: true });
|
| 14 |
+
}
|
| 15 |
|
| 16 |
+
return packet("control", { raw: text });
|
| 17 |
}
|
| 18 |
|
| 19 |
+
function packet(lane, payload) {
|
| 20 |
+
return {
|
| 21 |
+
lane,
|
| 22 |
+
payload,
|
| 23 |
+
timestamp: performance.now()
|
| 24 |
+
};
|
| 25 |
}
|