peterguo 3 weeks ago
parent
commit
c1925adaf5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Services/LLM/DeepSeekService.php

+ 2 - 1
app/Services/LLM/DeepSeekService.php

@@ -111,11 +111,12 @@ class DeepSeekService
 
         // 创建或获取会话
         if (!$sessionId) {
+            $title = mb_substr($userMessage['content'], 0, 50) . (mb_strlen($userMessage['content']) > 50 ? '...' : '');
             $session = LlmSession::create([
                 'session_id' => Str::uuid(),
                 'user_id' => Auth::id() ?? 0,
                 'model' => $model,
-                'title' => mb_substr($userMessage['content'], 0, 50) . mb_strlen($userMessage['content'] > 50 ? '...' : ''),
+                'title' => $title,
             ]);
         } else {
             $session = LlmSession::where('session_id', $sessionId)->firstOrFail();