Spaces:
Paused
Paused
Update server.js
Browse files
server.js
CHANGED
|
@@ -34,6 +34,7 @@ app.post('/update', async (req, res) => {
|
|
| 34 |
|
| 35 |
app.post('/pl', async (req, res) => {
|
| 36 |
const prompt = req.body.prompt;
|
|
|
|
| 37 |
const apiKey = req.body.api || getRandomApiKey();
|
| 38 |
|
| 39 |
if (!prompt) {
|
|
@@ -42,7 +43,7 @@ app.post('/pl', async (req, res) => {
|
|
| 42 |
|
| 43 |
try {
|
| 44 |
const response = await axios.post('https://openai-gemini-iota.vercel.app/v1/chat/completions', {
|
| 45 |
-
messages: [{'role': 'system', 'content': start}, {'role': 'user', 'content': prompt}],
|
| 46 |
max_tokens: 4000,
|
| 47 |
temperature: 0.7,
|
| 48 |
model: "gemini-1.5-pro-002",
|
|
|
|
| 34 |
|
| 35 |
app.post('/pl', async (req, res) => {
|
| 36 |
const prompt = req.body.prompt;
|
| 37 |
+
const lang = req.body.lang;
|
| 38 |
const apiKey = req.body.api || getRandomApiKey();
|
| 39 |
|
| 40 |
if (!prompt) {
|
|
|
|
| 43 |
|
| 44 |
try {
|
| 45 |
const response = await axios.post('https://openai-gemini-iota.vercel.app/v1/chat/completions', {
|
| 46 |
+
messages: [{'role': 'system', 'content': `${start}. Отвечай на языке: ${lang}`}, {'role': 'user', 'content': prompt}],
|
| 47 |
max_tokens: 4000,
|
| 48 |
temperature: 0.7,
|
| 49 |
model: "gemini-1.5-pro-002",
|