Prechádzať zdrojové kódy

更换gpt-image2中转站接口

lh 7 hodín pred
rodič
commit
c7b3c8c42b

+ 5 - 3
app/Services/AIGeneration/AIImageGenerationService.php

@@ -243,13 +243,15 @@ class AIImageGenerationService
             // 更新状态为处理中
             $task->updateStatus(MpGeneratePicTask::STATUS_PROCESSING);
             
-            $api_url = 'https://token.ithinkai.cn/v1/images/generations';
+            // $api_url = 'https://token.ithinkai.cn/v1/images/generations';
+            $api_url = 'https://api.nonelinear.com/v1/images/generations';
             $isEditMode = false;
             
             // 参考图片 - 如果有参考图则使用 /edits 接口
             if ($task->ref_img_url) {
-                $api_url = 'https://token.ithinkai.cn/v1/images/edits';
-                $isEditMode = true;
+                // $api_url = 'https://token.ithinkai.cn/v1/images/edits';
+                // $isEditMode = true;
+                $api_url = 'https://api.nonelinear.com/v1/images/generations';
             }
             
             dLog('generate')->info('开始调用GPT-Image2 API', ['task_id' => $task->task_id, 'mode' => $isEditMode ? 'edit' : 'generation']);

+ 3 - 1
app/Services/DeepSeek/DeepSeekService.php

@@ -1317,6 +1317,7 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         }
         $post_data['max_completion_tokens'] = 100000;
 
+        // 备用中转站地址: https://token.ithinkai.cn/v1/chat/completions
         $response = $client->post('https://api.nonelinear.com/v1/chat/completions', [
             'json' => $post_data, 
             'headers' => $headers
@@ -9943,6 +9944,7 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         // 确保 stream 为 false
         $post_data['stream'] = false;
 
+        // 备用中转站地址: https://token.ithinkai.cn/v1/chat/completions
         $result = $client->post('https://api.nonelinear.com/v1/chat/completions', [
             'json' => $post_data, 
             'headers' => $headers
@@ -10504,7 +10506,7 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         }else {
             $requestData['max_completion_tokens'] = 100000;
         }
-        
+
         if (isset($params['temperature'])) {
             $requestData['temperature'] = $params['temperature'];
         }