Explorar o código

1.更换gpt-5.4中转站API接口2.对话接口新增最大输出长度

lh hai 6 horas
pai
achega
81021bfec6
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      app/Services/DeepSeek/DeepSeekService.php

+ 8 - 2
app/Services/DeepSeek/DeepSeekService.php

@@ -1183,6 +1183,9 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
      * @return \Generator 返回生成器,用于流式输出
      */
     private function deepSeekStreamResponse($post_data) {
+        // 设置最大输出tokens
+        $post_data['max_tokens'] = 300000;
+
         $client = new Client(['timeout' => 1200, 'verify' => false]);
         $response = $client->post($this->url, [
             'json' => $post_data, 
@@ -1312,8 +1315,9 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         if (isset($post_data['reasoning_effort'])) {
             unset($post_data['reasoning_effort']);
         }
+        $post_data['max_completion_tokens'] = 100000;
 
-        $response = $client->post('https://token.ithinkai.cn/v1/chat/completions', [
+        $response = $client->post('https://api.nonelinear.com/v1/chat/completions', [
             'json' => $post_data, 
             'headers' => $headers
         ]);
@@ -9892,6 +9896,7 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
 
     // 仅调用deepseek对话接口
     private function chatOnly($post_data) {
+        $post_data['max_tokens'] = 300000;
         $client = new Client(['timeout' => 1200, 'verify' => false]);
         $result = $client->post($this->url, ['json' => $post_data, 'headers' => $this->headers]);
         $response = $result->getBody()->getContents();
@@ -9933,11 +9938,12 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         if (isset($post_data['reasoning_effort'])) {
             unset($post_data['reasoning_effort']);
         }
+        $post_data['max_completion_tokens'] = 100000;
 
         // 确保 stream 为 false
         $post_data['stream'] = false;
 
-        $result = $client->post('https://token.ithinkai.cn/v1/chat/completions', [
+        $result = $client->post('https://api.nonelinear.com/v1/chat/completions', [
             'json' => $post_data, 
             'headers' => $headers
         ]);