Update plugins/gptold.js
Browse files- plugins/gptold.js +78 -1
plugins/gptold.js
CHANGED
@@ -13,6 +13,8 @@ import {
|
|
13 |
LIRIKLAGU,
|
14 |
QUOTESLUCU,
|
15 |
QUOTESSEDIH,
|
|
|
|
|
16 |
} from '../models.js';
|
17 |
import {
|
18 |
AlibabaTogether,
|
@@ -337,6 +339,82 @@ GptRoutes.get('/api/v1/ai/akenox/mia-khalifah', authenticateApiKeyPremium, apiLi
|
|
337 |
}
|
338 |
});
|
339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
/**
|
341 |
* @swagger
|
342 |
* /api/v1/ai/akenox/quotes-sad:
|
@@ -375,7 +453,6 @@ GptRoutes.get('/api/v1/ai/akenox/quotes-sad', authenticateApiKeyPremium, apiLimi
|
|
375 |
}
|
376 |
});
|
377 |
|
378 |
-
|
379 |
/**
|
380 |
* @swagger
|
381 |
* /api/v1/ai/akenox/quotes-lucu:
|
|
|
13 |
LIRIKLAGU,
|
14 |
QUOTESLUCU,
|
15 |
QUOTESSEDIH,
|
16 |
+
PythonToJS,
|
17 |
+
JsToPython,
|
18 |
} from '../models.js';
|
19 |
import {
|
20 |
AlibabaTogether,
|
|
|
339 |
}
|
340 |
});
|
341 |
|
342 |
+
/**
|
343 |
+
* @swagger
|
344 |
+
* /api/v1/ai/akenox/python-to-js-api:
|
345 |
+
* get:
|
346 |
+
* summary: Custom Python to JS Requests Converter AI
|
347 |
+
* tags: [AI]
|
348 |
+
* parameters:
|
349 |
+
* - in: query
|
350 |
+
* name: query
|
351 |
+
* required: true
|
352 |
+
* description: User's input query
|
353 |
+
* schema:
|
354 |
+
* type: string
|
355 |
+
* - in: header
|
356 |
+
* name: x-api-key
|
357 |
+
* required: true
|
358 |
+
* description: API key for authentication
|
359 |
+
* schema:
|
360 |
+
* type: string
|
361 |
+
* responses:
|
362 |
+
* 200:
|
363 |
+
* description: Success
|
364 |
+
*/
|
365 |
+
GptRoutes.get('/api/v1/ai/akenox/python-to-js-api', authenticateApiKeyPremium, apiLimiter, async (req, res) => {
|
366 |
+
try {
|
367 |
+
const query = req.query.query;
|
368 |
+
if (!query) {
|
369 |
+
return res.status(500).json({ error: "query required" });
|
370 |
+
}
|
371 |
+
const results = await CloudFlareQwenTogether(query, {
|
372 |
+
system_prompt: PythonToJS
|
373 |
+
});
|
374 |
+
res.json({ results });
|
375 |
+
} catch (error) {
|
376 |
+
res.status(401).json({ error: error.message });
|
377 |
+
}
|
378 |
+
});
|
379 |
+
|
380 |
+
/**
|
381 |
+
* @swagger
|
382 |
+
* /api/v1/ai/akenox/js-to-python-api:
|
383 |
+
* get:
|
384 |
+
* summary: Custom JS to Python Requests Converter AI
|
385 |
+
* tags: [AI]
|
386 |
+
* parameters:
|
387 |
+
* - in: query
|
388 |
+
* name: query
|
389 |
+
* required: true
|
390 |
+
* description: User's input query
|
391 |
+
* schema:
|
392 |
+
* type: string
|
393 |
+
* - in: header
|
394 |
+
* name: x-api-key
|
395 |
+
* required: true
|
396 |
+
* description: API key for authentication
|
397 |
+
* schema:
|
398 |
+
* type: string
|
399 |
+
* responses:
|
400 |
+
* 200:
|
401 |
+
* description: Success
|
402 |
+
*/
|
403 |
+
GptRoutes.get('/api/v1/ai/akenox/js-to-python-api', authenticateApiKeyPremium, apiLimiter, async (req, res) => {
|
404 |
+
try {
|
405 |
+
const query = req.query.query;
|
406 |
+
if (!query) {
|
407 |
+
return res.status(500).json({ error: "query required" });
|
408 |
+
}
|
409 |
+
const results = await CloudFlareQwenTogether(query, {
|
410 |
+
system_prompt: JsToPython
|
411 |
+
});
|
412 |
+
res.json({ results });
|
413 |
+
} catch (error) {
|
414 |
+
res.status(401).json({ error: error.message });
|
415 |
+
}
|
416 |
+
});
|
417 |
+
|
418 |
/**
|
419 |
* @swagger
|
420 |
* /api/v1/ai/akenox/quotes-sad:
|
|
|
453 |
}
|
454 |
});
|
455 |
|
|
|
456 |
/**
|
457 |
* @swagger
|
458 |
* /api/v1/ai/akenox/quotes-lucu:
|