Browse Source

add summarize

visuddhinanda 9 tháng trước cách đây
mục cha
commit
4cedd1f4f9
1 tập tin đã thay đổi với 10 bổ sung2 xóa
  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;
     }
 }