chengjie hai 4 meses
pai
achega
0aea9ffd92

+ 3 - 3
src/api/yjbdc/aiController.js

@@ -62,7 +62,7 @@ class VolcesAIProvider extends AIProvider {
62 62
      * 创建火山云AI提供者实例
63 63
      * @param {string} version - 版本号
64 64
      */
65
-    constructor(version = 'doubao-1-5-pro-32k-250115') {
65
+    constructor(version) {
66 66
         super();
67 67
         
68 68
         if (version.indexOf("deepseek")>0){
@@ -422,7 +422,7 @@ class AIProviderFactory {
422 422
      * @param {string} provider - AI提供者名称
423 423
      * @returns {AIProvider} - 返回对应的AI提供者实例
424 424
      */
425
-    static getProvider(provider = 'doubao-1-5-pro-32k-250115') {
425
+    static getProvider(provider) {
426 426
         const providerLower = provider.toLowerCase();
427 427
         
428 428
         // 处理传统提供者名称
@@ -452,7 +452,7 @@ class AIProviderFactory {
452 452
             case 'baidu-ernie-4.5-turbo-vl-32k-preview':
453 453
                 return new BaiduAIProvider("ernie-4.5-turbo-vl-32k-preview");
454 454
             default:
455
-                return new VolcesAIProvider(providerLower); // 默认使用火山云1.5
455
+                return new VolcesAIProvider("doubao-1-5-pro-32k-250115"); // 默认使用火山云1.5
456 456
         }
457 457
     }
458 458
 }

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

@@ -214,13 +214,13 @@ export async function GenerateArticle(ctx) {
214 214
             }
215 215
             content = content.replace("[难度]",menuConfig.Level[Number(params.Level)].Content);
216 216
             
217
-            if (articleStyle=="随机" || articleStyle=="任意") {
218
-                // 获取ARTICLE_STYLE对象的所有键(文章类型)
219
-                const articleTypes = Object.keys(ARTICLE_STYLE);
220
-                // 随机选择一个文章类型
221
-                const randomIndex = stringUtils.Random(0, articleTypes.length-1);
222
-                articleStyle = articleTypes[randomIndex];
223
-            }
217
+            // if (articleStyle=="随机" || articleStyle=="任意") {
218
+            //     // 获取ARTICLE_STYLE对象的所有键(文章类型)
219
+            //     const articleTypes = Object.keys(ARTICLE_STYLE);
220
+            //     // 随机选择一个文章类型
221
+            //     const randomIndex = stringUtils.Random(0, articleTypes.length-1);
222
+            //     articleStyle = articleTypes[randomIndex];
223
+            // }
224 224
             for(let i=0;i<menuConfig.ArticleStyle.length;i++){
225 225
                 if (menuConfig.ArticleStyle[i].Name==articleStyle){
226 226
                     content = content.replace("[类型]",menuConfig.ArticleStyle[i].Content);
@@ -231,8 +231,7 @@ export async function GenerateArticle(ctx) {
231 231
             //console.log("content:"+content);
232 232
             
233 233
             // 从请求参数中获取AI提供者,如果没有指定则使用默认值
234
-            let aiProvider = 'doubao-1-5-pro-32k-250115';
235
-
234
+            let aiProvider = '';
236 235
             for(let i=0;i<menuConfig.AIVersion.length;i++){
237 236
                 if (menuConfig.AIVersion[i].Version==params.AIVersion){
238 237
                     aiProvider=menuConfig.AIVersion[i].Model;

+ 6 - 4
src/util/constant/index.js

@@ -12,7 +12,8 @@ export default {
12 12
             {Name:"小学",CSS:"Selected",English:"Primary school vocabulary size",Content:"生成难度是CEFR语言能力评估框架的A2标准"},
13 13
             {Name:"初中",CSS:"",English:"Junior high school vocabulary size",Content:"生成难度是CEFR语言能力评估框架的B1标准"},
14 14
             {Name:"高中",CSS:"",English:"High school vocabulary size",Content:"生成难度是CEFR语言能力评估框架的B2标准"},
15
-            {Name:"大学",CSS:"",English:"College vocabulary size",Content:"生成难度是CEFR语言能力评估框架的C1标准"}];            
15
+            {Name:"大学",CSS:"",English:"College vocabulary size",Content:"生成难度是CEFR语言能力评估框架的C1标准"}
16
+        ];            
16 17
         result.ArticleStyle=[
17 18
             {Name:"童话",CSS:"Selected",English:"Fairy Tales",Content:"充满神奇和想象的故事,里面可能有会说话的动物、美丽的公主、勇敢的王子,还有魔法和冒险,比如《白雪公主》、《小红帽》。"},
18 19
             {Name:"奇幻",CSS:"",English:"Fantasy",Content:"充满魔法、神奇生物和不可思议事件的故事,比如《哈利·波特》。"},
@@ -25,9 +26,10 @@ export default {
25 26
             {Name:"大自然",CSS:"",English:"Environmental Stories",Content:"指环境保护、保护大自然,让地球更干净、更健康。比如节约用水、减少垃圾、种树、不乱扔塑料袋,这样空气会更清新,动物也有更好的家园。每个人都可以从小事做起爱护地球。"},
26 27
             {Name:"科普",CSS:"",English:"Popular Science",Content:"科学普及知识,用有趣的方式讲解自然、宇宙、动物、植物等科学现象,比如《十万个为什么》。"},
27 28
             {Name:"节日文化",CSS:"",English:"Cultural Stories",Content:"不同节日的习俗和传统,比如春节贴春联、中秋节吃月饼、端午划龙舟、清明节扫墓、重阳节登高望远、元宵节猜灯谜,让我们了解不同文化。"},
28
-            {Name:"人生励志",CSS:"",English:"Inspirational",Content:"讲述一个人如何克服困难、努力奋斗,最终取得成功的故事,鼓励我们不要轻易放弃,比如《爱迪生发明电灯》。"}];        
29
+            {Name:"人生励志",CSS:"",English:"Inspirational",Content:"讲述一个人如何克服困难、努力奋斗,最终取得成功的故事,鼓励我们不要轻易放弃,比如《爱迪生发明电灯》。"}
30
+        ];        
29 31
         result.AIVersion=[
30
-            {Version:"1.0",BuildSecond:20,Model:"",Content:"词句丰富,结构简明\n平均20秒生成",CSS:"Selected"},
32
+            {Version:"1.0",BuildSecond:15,Model:"",Content:"词句丰富,结构简明\n平均15秒生成",CSS:"Selected"},
31 33
             {Version:"1.5",BuildSecond:60,Model:"",Content:"深度表达,更多要素\n平均60秒生成",CSS:""},
32 34
             {Version:"db15",BuildSecond:30,Model:"doubao-1-5-pro-32k-250115",Content:"字节豆包1.5\n平均30秒生成",CSS:"Selected"},
33 35
             {Version:"db16",BuildSecond:60,Model:"doubao-seed-1-6-250615",Content:"字节豆包1.6\n平均60秒生成",CSS:""},
@@ -35,7 +37,7 @@ export default {
35 37
             {Version:"dpr",BuildSecond:120,Model:"doubao-deepseek-r1-250528",Content:"字节deepseek_r1\n平均120秒生成",CSS:""},
36 38
             {Version:"qwp",BuildSecond:30,Model:"ali-qwen-plus",Content:"阿里千问plus\n平均30秒生成",CSS:""},
37 39
             {Version:"qwm",BuildSecond:45,Model:"ali-qwen-plus",Content:"阿里千问Max\n平均45秒生成",CSS:""},
38
-            {Version:"lm4",BuildSecond:15,Model:"llama-4-maverick-17b-128e-instruct",Content:"阿里脸书llama4\n平均45秒生成",CSS:""},
40
+            {Version:"lm4",BuildSecond:15,Model:"llama-4-maverick-17b-128e-instruct",Content:"阿里脸书llama4\n平均15秒生成",CSS:""},
39 41
             {Version:"hytb",BuildSecond:30,Model:"tencent-hunyuan-turbos-latest",Content:"腾讯混元turbos\n平均30秒生成",CSS:""},
40 42
             {Version:"hyt1",BuildSecond:40,Model:"tencent-hunyuan-t1-latest",Content:"腾讯混元t1\n平均40秒生成",CSS:""},
41 43
             {Version:"x1",BuildSecond:60,Model:"xf-yun-spark-x1",Content:"讯飞sparkX1\n平均60秒生成",CSS:""},