randydev commited on
Commit
2ed4152
·
verified ·
1 Parent(s): 95871cd

Update lib/@randydev/together/qwen-ai.js

Browse files
Files changed (1) hide show
  1. lib/@randydev/together/qwen-ai.js +20 -0
lib/@randydev/together/qwen-ai.js CHANGED
@@ -18,6 +18,26 @@ export async function Qwen323NewResponse(message) {
18
  return chatCompletion.choices[0].message
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  export async function CloudFlareQwenTogether(message, { system_prompt = "" } = {}) {
22
  const run = await got.post(`https://api.cloudflare.com/client/v4/accounts/${process.env['ACCOUNT_ID']}/ai/run/@cf/qwen/qwen1.5-1.8b-chat`, {
23
  headers: {
 
18
  return chatCompletion.choices[0].message
19
  }
20
 
21
+ export async function CloudFlareQwen32BTogether(message, { system_prompt = "" } = {}) {
22
+ const run = await got.post(`https://api.cloudflare.com/client/v4/accounts/${process.env['ACCOUNT_ID']}/ai/run/@cf/qwen/qwq-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
+ 'temperature': 0.7,
33
+ 'top_p': 0.7,
34
+ 'repetition_penalty': 1,
35
+ 'stream': false
36
+ }
37
+ }).json();
38
+ return run.result.response;
39
+ }
40
+
41
  export async function CloudFlareQwenTogether(message, { system_prompt = "" } = {}) {
42
  const run = await got.post(`https://api.cloudflare.com/client/v4/accounts/${process.env['ACCOUNT_ID']}/ai/run/@cf/qwen/qwen1.5-1.8b-chat`, {
43
  headers: {