Update server.js
Browse files
server.js
CHANGED
@@ -56,7 +56,7 @@ app.post('/pl', async (req, res) => {
|
|
56 |
|
57 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
58 |
const content = response.data.choices[0].message.content.trim();
|
59 |
-
|
60 |
res.json({ content });
|
61 |
} else {
|
62 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|
@@ -90,7 +90,7 @@ app.post('/cre', async (req, res) => {
|
|
90 |
|
91 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
92 |
const content = response.data.choices[0].message.content.trim();
|
93 |
-
|
94 |
res.json({ content });
|
95 |
} else {
|
96 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|
@@ -124,7 +124,7 @@ app.post('/crebeta', async (req, res) => {
|
|
124 |
|
125 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
126 |
const content = response.data.choices[0].message.content.trim();
|
127 |
-
|
128 |
res.json({ content });
|
129 |
} else {
|
130 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|
|
|
56 |
|
57 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
58 |
const content = response.data.choices[0].message.content.trim();
|
59 |
+
console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`);
|
60 |
res.json({ content });
|
61 |
} else {
|
62 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|
|
|
90 |
|
91 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
92 |
const content = response.data.choices[0].message.content.trim();
|
93 |
+
console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`);
|
94 |
res.json({ content });
|
95 |
} else {
|
96 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|
|
|
124 |
|
125 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
126 |
const content = response.data.choices[0].message.content.trim();
|
127 |
+
console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`);
|
128 |
res.json({ content });
|
129 |
} else {
|
130 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|