feat: 添加会话标题自动生成功能

- 后端:首次 AI 回复后自动从用户消息提取标题
- 后端:通过 WebSocket 推送 session_updated 事件
- 前端:useChat hook 处理标题更新事件
- 前端:Sidebar 组件实时更新会话标题显示
This commit is contained in:
2025-12-12 17:45:17 +08:00
parent f561687307
commit 65a23f1e71
9 changed files with 141 additions and 3 deletions
+3
View File
@@ -16,6 +16,7 @@ import {
interface ChatPageProps {
sessionId: string;
onSessionNotFound?: () => void;
onSessionUpdated?: (sessionId: string, name: string) => void;
responsive?: boolean;
// 工具栏按钮
showFileBrowser?: boolean;
@@ -26,6 +27,7 @@ interface ChatPageProps {
export function ChatPage({
sessionId,
onSessionNotFound,
onSessionUpdated,
responsive = false,
showFileBrowser,
onToggleFileBrowser,
@@ -44,6 +46,7 @@ export function ChatPage({
console.error('Chat error:', error);
},
onSessionNotFound,
onSessionUpdated,
});
const messagesEndRef = useRef<HTMLDivElement>(null);