randydev commited on
Commit
8ee8880
·
verified ·
1 Parent(s): af69424

Update plugins/gptold.js

Browse files
Files changed (1) hide show
  1. plugins/gptold.js +48 -1
plugins/gptold.js CHANGED
@@ -2,7 +2,10 @@ import express from 'express';
2
  import { OpenaiRes } from '../lib/scrapper.js';
3
  import { NvidiaTogether } from '../lib/@randydev/together/llama.js';
4
  import { CohereAI } from '../lib/@randydev/together/cohere.js';
5
- import { AlibabaTogether } from '../lib/@randydev/together/qwen-ai.js';
 
 
 
6
  import { DeepSeekR1 } from '../lib/@randydev/together/blackbox.js';
7
  import { authenticateApiKey, authenticateApiKeyPremium, apiLimiter } from '../middleware/midware.js';
8
  const GptRoutes = express.Router();
@@ -41,6 +44,50 @@ GptRoutes.get('/api/v1/ai/deepseek/deepseek-R1', authenticateApiKeyPremium, apiL
41
  }
42
  });
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  /**
45
  * @swagger
46
  * /api/v1/ai/alibaba/qwen-plus:
 
2
  import { OpenaiRes } from '../lib/scrapper.js';
3
  import { NvidiaTogether } from '../lib/@randydev/together/llama.js';
4
  import { CohereAI } from '../lib/@randydev/together/cohere.js';
5
+ import {
6
+ AlibabaTogether,
7
+ CloudFlareQwenTogether
8
+ } from '../lib/@randydev/together/qwen-ai.js';
9
  import { DeepSeekR1 } from '../lib/@randydev/together/blackbox.js';
10
  import { authenticateApiKey, authenticateApiKeyPremium, apiLimiter } from '../middleware/midware.js';
11
  const GptRoutes = express.Router();
 
44
  }
45
  });
46
 
47
+ /**
48
+ * @swagger
49
+ * /api/v1/ai/qwen/qwen1.5-1.8b-chat:
50
+ * get:
51
+ * summary: Alibaba Qwen AI
52
+ * tags: [AI]
53
+ * parameters:
54
+ * - in: query
55
+ * name: query
56
+ * required: true
57
+ * description: User's input query
58
+ * schema:
59
+ * type: string
60
+ * - in: query
61
+ * name: system_prompt
62
+ * required: false
63
+ * description: Custom system prompt
64
+ * schema:
65
+ * type: string
66
+ * - in: header
67
+ * name: x-api-key
68
+ * required: true
69
+ * description: API key for authentication
70
+ * schema:
71
+ * type: string
72
+ * responses:
73
+ * 200:
74
+ * description: Success
75
+ */
76
+ GptRoutes.get('/api/v1/ai/qwen/qwen1.5-1.8b-chat', authenticateApiKeyPremium, apiLimiter, async (req, res) => {
77
+ try {
78
+ const query = req.query.query;
79
+ const system_prompt = req.query.system_prompt || "Your name is AkenoX AI A kind and friendly AI assistant that answers in a short and concise answer. Give short step-by-step reasoning if required.";
80
+
81
+ const results = await CloudFlareQwenTogether(query, {
82
+ system_prompt: system_prompt
83
+ });
84
+
85
+ res.json({ results });
86
+ } catch (error) {
87
+ res.status(401).json({ error: error.message });
88
+ }
89
+ });
90
+
91
  /**
92
  * @swagger
93
  * /api/v1/ai/alibaba/qwen-plus: