Update lib/@randydev/together/qwen-ai.js
Browse files
lib/@randydev/together/qwen-ai.js
CHANGED
@@ -18,6 +18,24 @@ async function CloudFlareQwenTogether(message, { system_prompt = "" } = {}) {
|
|
18 |
return run.result.response;
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
async function AlibabaTogether(message, { system_prompt = "" } = {}) {
|
22 |
const response = await got.post('https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions', {
|
23 |
headers: {
|
@@ -41,5 +59,6 @@ async function AlibabaTogether(message, { system_prompt = "" } = {}) {
|
|
41 |
}
|
42 |
export {
|
43 |
AlibabaTogether,
|
44 |
-
CloudFlareQwenTogether
|
|
|
45 |
};
|
|
|
18 |
return run.result.response;
|
19 |
}
|
20 |
|
21 |
+
async function DeepseekQwenTogether(message, { system_prompt = "" } = {}) {
|
22 |
+
const run = await got.post(`https://api.cloudflare.com/client/v4/accounts/${process.env['ACCOUNT_ID']}/ai/run/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b`, {
|
23 |
+
headers: {
|
24 |
+
'Authorization': `Bearer ${process.env['CLOUDFLARE_API_KEY']}`,
|
25 |
+
'Content-Type': 'application/json'
|
26 |
+
},
|
27 |
+
json: {
|
28 |
+
'messages': [
|
29 |
+
{"role": "system", "content": system_prompt},
|
30 |
+
{"role": "user", "content": message}
|
31 |
+
],
|
32 |
+
'max_tokens': 200,
|
33 |
+
'stream': false
|
34 |
+
}
|
35 |
+
}).json();
|
36 |
+
return run.result.response;
|
37 |
+
}
|
38 |
+
|
39 |
async function AlibabaTogether(message, { system_prompt = "" } = {}) {
|
40 |
const response = await got.post('https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions', {
|
41 |
headers: {
|
|
|
59 |
}
|
60 |
export {
|
61 |
AlibabaTogether,
|
62 |
+
CloudFlareQwenTogether,
|
63 |
+
DeepseekQwenTogether
|
64 |
};
|