chengjie 4 月之前
父节点
当前提交
aef2f62b18
共有 3 个文件被更改,包括 19 次插入2 次删除
  1. 9 2
      src/api/yjbdc/aiController.js
  2. 9 0
      src/api/yjbdc/yjbdcController.js
  3. 1 0
      src/util/constant/index.js

+ 9 - 2
src/api/yjbdc/aiController.js

@@ -210,12 +210,17 @@ class AliyunAIProvider extends AIProvider {
210 210
     constructor(model = 'qwen-plus') {
211 211
         super();
212 212
 
213
+        let url="https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions";
214
+        // if (model=="llama-4-maverick-17b-128e-instruct")
215
+        //     url="https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation";
216
+
213 217
         this.accessKey = config.aliyun.apikeyHLR;
218
+        
214 219
         this.headers = {
215 220
             "Content-Type": "application/json",
216 221
             "Accept": "application/json"
217 222
         };
218
-        this.url = "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions";
223
+        this.url = url;
219 224
         this.model = model;
220 225
     }
221 226
 
@@ -241,7 +246,7 @@ class AliyunAIProvider extends AIProvider {
241 246
         };
242 247
 
243 248
         try {
244
-            console.log(`阿里云通义 ${this.model}`);
249
+            console.log(`阿里云 ${this.model}`);
245 250
             const response = await axios.post(this.url, postJSON, { headers: this.headers });
246 251
             
247 252
             // 根据阿里云通义API的返回格式提取内容
@@ -432,6 +437,8 @@ class AIProviderFactory {
432 437
                 return new AliyunAIProvider("qwen-plus");
433 438
             case 'ali-qwen-max':
434 439
                 return new AliyunAIProvider("qwen-max");
440
+            case 'llama-4-maverick-17b-128e-instruct':
441
+                return new AliyunAIProvider(providerLower);
435 442
             case 'xf-yun-spark-x1':
436 443
                 return new XunFeiYunAIProvider();
437 444
             case 'tencent-hunyuan-turbos-latest':

+ 9 - 0
src/api/yjbdc/yjbdcController.js

@@ -239,6 +239,15 @@ export async function GenerateArticle(ctx) {
239 239
                     break;
240 240
                 }
241 241
             }
242
+
243
+            //给用户一些比较好的体验
244
+            if (params.UserID>3 && params.AIVersion=="1.0"){
245
+                aiProvider = 'llama-4-maverick-17b-128e-instruct';
246
+            }
247
+            else if (params.UserID>3 && params.AIVersion=="1.5"){
248
+                aiProvider = 'doubao-seed-1-6-250615';
249
+            }
250
+            
242 251
             
243 252
             try {
244 253
                 //开始时间

+ 1 - 0
src/util/constant/index.js

@@ -32,6 +32,7 @@ export default {
32 32
             {Version:"x1",BuildSecond:60,Model:"xf-yun-spark-x1",Content:"讯飞sparkX1\n平均60秒生成",CSS:""},
33 33
             {Version:"qwp",BuildSecond:30,Model:"ali-qwen-plus",Content:"阿里千问plus\n平均30秒生成",CSS:""},
34 34
             {Version:"qwm",BuildSecond:45,Model:"ali-qwen-plus",Content:"阿里千问Max\n平均45秒生成",CSS:""},
35
+            {Version:"lm4",BuildSecond:15,Model:"llama-4-maverick-17b-128e-instruct",Content:"阿里脸书llama4\n平均45秒生成",CSS:""},
35 36
             {Version:"hytb",BuildSecond:30,Model:"tencent-hunyuan-turbos-latest",Content:"腾讯混元turbos\n平均30秒生成",CSS:""},
36 37
             {Version:"hyt1",BuildSecond:40,Model:"tencent-hunyuan-t1-latest",Content:"腾讯混元t1\n平均40秒生成",CSS:""},
37 38
             {Version:"dp3",BuildSecond:60,Model:"doubao-deepseek-v3-250324",Content:"字节deepseek_v3\n平均60秒生成",CSS:""},