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
@@ -15,6 +15,7 @@ import {
interface ChatPageProps {
sessionId: string;
onSessionUpdated?: (sessionId: string, name: string) => void;
// 工具栏按钮
showFileBrowser?: boolean;
onToggleFileBrowser?: () => void;
@@ -23,6 +24,7 @@ interface ChatPageProps {
export function ChatPage({
sessionId,
onSessionUpdated,
showFileBrowser,
onToggleFileBrowser,
onOpenConfig,
@@ -39,6 +41,7 @@ export function ChatPage({
onError: (error) => {
console.error('Chat error:', error);
},
onSessionUpdated,
});
const messagesEndRef = useRef<HTMLDivElement>(null);