Spaces:
Running
Running
Update server.js
Browse files
server.js
CHANGED
@@ -71,14 +71,14 @@ app.post('/cre', async (req, res) => {
|
|
71 |
}
|
72 |
|
73 |
try {
|
74 |
-
const response = await axios.post('https://
|
75 |
messages: [{'role': 'system', 'content': start}, {'role': 'system', 'content': 'И ОБЯЗАТЕЛЬНО, всегда в конце "text" проси обновить приложение, уведомляя о том, что скоро в жтой версии перестанешь отвечать!'}, {'role': 'user', 'content': prompt}],
|
76 |
max_tokens: 2000,
|
77 |
temperature: 0.6,
|
78 |
// presence_penalty: 0.0,
|
79 |
//frequency_penalty: -0.1,
|
80 |
-
|
81 |
-
|
82 |
//model: "gemini-1.5-flash-latest",
|
83 |
}, {
|
84 |
headers: {
|
@@ -89,7 +89,7 @@ app.post('/cre', async (req, res) => {
|
|
89 |
|
90 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
91 |
const content = response.data.choices[0].message.content.trim();
|
92 |
-
|
93 |
res.json({ content });
|
94 |
} else {
|
95 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|
|
|
71 |
}
|
72 |
|
73 |
try {
|
74 |
+
const response = await axios.post('https://vercel.com/roonis-projects/openai-gemini/v1/chat/completions', {
|
75 |
messages: [{'role': 'system', 'content': start}, {'role': 'system', 'content': 'И ОБЯЗАТЕЛЬНО, всегда в конце "text" проси обновить приложение, уведомляя о том, что скоро в жтой версии перестанешь отвечать!'}, {'role': 'user', 'content': prompt}],
|
76 |
max_tokens: 2000,
|
77 |
temperature: 0.6,
|
78 |
// presence_penalty: 0.0,
|
79 |
//frequency_penalty: -0.1,
|
80 |
+
model: "gemini-1.5-pro-002",
|
81 |
+
// model: "deepseek-chat",
|
82 |
//model: "gemini-1.5-flash-latest",
|
83 |
}, {
|
84 |
headers: {
|
|
|
89 |
|
90 |
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
|
91 |
const content = response.data.choices[0].message.content.trim();
|
92 |
+
// console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`);
|
93 |
res.json({ content });
|
94 |
} else {
|
95 |
res.status(500).json({ content: 'errora' }); // Ошибка прочтения
|