浏览代码

add summarize

visuddhinanda 9 月之前
父节点
当前提交
4cedd1f4f9
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      api-v8/app/Services/AIModelService.php

+ 10 - 2
api-v8/app/Services/AIModelService.php

@@ -16,13 +16,21 @@ class AIModelService
         return AiModelResource::collection(resource: $result);
     }
 
-    public function getSysModels()
+    public function getSysModels($type = null)
     {
-        $types = ['wbw', 'chat'];
+        if (empty($type)) {
+            $types = ['wbw', 'chat', 'summarize'];
+        } else {
+            $types = [$type];
+        }
+
         $sysModels = [];
         foreach ($types as $key => $type) {
             $sysModels[$type] =  $this->getModelsById(RedisClusters::get('/ai/model/system/' . $type) ?? []);
         }
+        if (!empty($type)) {
+            return $sysModels[$type];
+        }
         return $sysModels;
     }
 }