作者 李宇航

合并分支 'lyh-server' 到 'master'

gx



查看合并请求 !1707
@@ -71,10 +71,10 @@ class ChatLogic extends BaseLogic @@ -71,10 +71,10 @@ class ChatLogic extends BaseLogic
71 $chunk = $stream->read(1024); 71 $chunk = $stream->read(1024);
72 if ($chunk !== false) { 72 if ($chunk !== false) {
73 $chunk = json_decode($chunk,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); 73 $chunk = json_decode($chunk,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
74 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($chunk['text'], true) . PHP_EOL, FILE_APPEND);  
75 - $aiResponse .= $chunk['text']; // 累积完整的 AI 回复 74 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($chunk, true) . PHP_EOL, FILE_APPEND);
  75 + $aiResponse .= $chunk; // 累积完整的 AI 回复
76 // 使用 en_sse_data 格式化流数据 76 // 使用 en_sse_data 格式化流数据
77 - echo $gptService->en_sse_data(trim($chunk['text'])); 77 + echo $gptService->en_sse_data(trim($chunk));
78 ob_flush(); 78 ob_flush();
79 flush(); 79 flush();
80 } 80 }