Spaces:
Running
Running
Update server.js
Browse files
server.js
CHANGED
@@ -69,6 +69,7 @@ app.post('/pl', async (req, res) => {
|
|
69 |
|
70 |
app.post('/pls', async (req, res) => {
|
71 |
const prompt = req.body.prompt;
|
|
|
72 |
const apiKey = req.body.api || getRandomApiKey();
|
73 |
|
74 |
if (!prompt) {
|
@@ -77,7 +78,7 @@ app.post('/pls', async (req, res) => {
|
|
77 |
|
78 |
try {
|
79 |
const response = await axios.post('https://openai-gemini-iota.vercel.app/v1/chat/completions', {
|
80 |
-
messages: [{'role': 'system', 'content': `${start}. Отвечай
|
81 |
max_tokens: 2000,
|
82 |
temperature: 0.7,
|
83 |
model: "gemini-1.5-pro-002",
|
|
|
69 |
|
70 |
app.post('/pls', async (req, res) => {
|
71 |
const prompt = req.body.prompt;
|
72 |
+
const lang = req.body.lang || "ru";
|
73 |
const apiKey = req.body.api || getRandomApiKey();
|
74 |
|
75 |
if (!prompt) {
|
|
|
78 |
|
79 |
try {
|
80 |
const response = await axios.post('https://openai-gemini-iota.vercel.app/v1/chat/completions', {
|
81 |
+
messages: [{'role': 'system', 'content': `${start}. Отвечай на языке: ${lang}`}, {'role': 'user', 'content': prompt}],
|
82 |
max_tokens: 2000,
|
83 |
temperature: 0.7,
|
84 |
model: "gemini-1.5-pro-002",
|