Update server.js
Browse files
server.js
CHANGED
|
@@ -30,7 +30,7 @@ async function gemini(sessionId, prompt) {
|
|
| 30 |
const sessionFile = getSessionFile(sessionId, 'gemini');
|
| 31 |
let history = [];
|
| 32 |
if (fs.existsSync(sessionFile)) {
|
| 33 |
-
history = JSON.parse(fs.readFileSync(
|
| 34 |
}
|
| 35 |
history.push({ role: 'user', content: { parts: [{ text: prompt }] } });
|
| 36 |
|
|
@@ -53,7 +53,7 @@ async function deepseek(sessionId, prompt) {
|
|
| 53 |
const sessionFile = getSessionFile(sessionId, 'deepseek');
|
| 54 |
let history = [];
|
| 55 |
if (fs.existsSync(sessionFile)) {
|
| 56 |
-
history = JSON.parse(fs.readFileSync(
|
| 57 |
}
|
| 58 |
history.push({ role: 'user', content: prompt });
|
| 59 |
|
|
@@ -73,7 +73,7 @@ async function qwen(sessionId, prompt) {
|
|
| 73 |
const sessionFile = getSessionFile(sessionId, 'qwen');
|
| 74 |
let history = [];
|
| 75 |
if (fs.existsSync(sessionFile)) {
|
| 76 |
-
history = JSON.parse(fs.readFileSync(
|
| 77 |
}
|
| 78 |
history.push({ role: 'user', content: prompt });
|
| 79 |
|
|
|
|
| 30 |
const sessionFile = getSessionFile(sessionId, 'gemini');
|
| 31 |
let history = [];
|
| 32 |
if (fs.existsSync(sessionFile)) {
|
| 33 |
+
history = JSON.parse(fs.readFileSync(sessionFile, 'utf8'));
|
| 34 |
}
|
| 35 |
history.push({ role: 'user', content: { parts: [{ text: prompt }] } });
|
| 36 |
|
|
|
|
| 53 |
const sessionFile = getSessionFile(sessionId, 'deepseek');
|
| 54 |
let history = [];
|
| 55 |
if (fs.existsSync(sessionFile)) {
|
| 56 |
+
history = JSON.parse(fs.readFileSync(sessionId, 'utf8'));
|
| 57 |
}
|
| 58 |
history.push({ role: 'user', content: prompt });
|
| 59 |
|
|
|
|
| 73 |
const sessionFile = getSessionFile(sessionId, 'qwen');
|
| 74 |
let history = [];
|
| 75 |
if (fs.existsSync(sessionFile)) {
|
| 76 |
+
history = JSON.parse(fs.readFileSync(sessionFile, 'utf8'));
|
| 77 |
}
|
| 78 |
history.push({ role: 'user', content: prompt });
|
| 79 |
|