Spaces:
Paused
Paused
Update server.js
Browse files23 unmodified lines242526272728293031 unmodified lines626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410523 unmodified lines res.json({ content: `{"whate":"🪨", "howe":"ОБНОВИТЕСЬ", "text":"Текущая версия приложения устарела. Установите новую из нашего телеграм канала: @yufi_ru", "succ":"победа", "what":"Версию", "how":"Обновите", "howl":"@yufi_ru"}` });});
app.post('/cre', async (req, res) => {app.post('/pl', async (req, res) => { const prompt = req.body.prompt; const apiKey = req.body.api || openai_key;
31 unmodified lines }});
app.post('/cre', async (req, res) => { const prompt = req.body.prompt; const apiKey = req.body.api || openai_key;
if (!prompt) { return res.status(400).json("wait"); // Не удалось принять данные }
try { const response = await axios.post('https://api.deepseek.com/v1/chat/completions', { messages: [{'role': 'system', 'content': start}, {'role': 'system', 'content': 'И ОБЯЗАТЕЛЬНО в конце "текст" проси обновить приложение!'}, {'role': 'user', 'content': prompt}], max_tokens: 2000, temperature: 0.6, // presence_penalty: 0.0, //frequency_penalty: -0.1, //model: "gemini-1.5-pro-latest", model: "deepseek-chat", //model: "gemini-1.5-flash-latest", }, { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', }, });
if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) { const content = response.data.choices[0].message.content.trim(); console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`); res.json({ content }); } else { res.status(500).json({ content: 'errora' }); // Ошибка прочтения } } catch (error) { console.error(error); res.status(500).json({ content: 'errorb' }); // ❌ Произошла ошибка сервера при генерации. }});
app.post('/crebeta', async (req, res) => { const prompt = req.body.prompt; const apiKey = req.body.api || openai_key;server.js+39-1