feat: Enhance chat and knowledge base functionalities with multi-KB support
- Updated agentChat API to accept optional knowledge_base_ids and agent_enabled parameters. - Introduced getSession API to retrieve session details. - Modified useStream to validate knowledge_base_ids for agent-chat requests and prepare POST body accordingly. - Enhanced createKnowledgeBase API to include additional configuration options. - Refactored chat routing to remove knowledge base ID from the chat path, allowing for dynamic knowledge base selection. - Improved session management by preventing duplicate session entries in the menu store. - Updated UI components for better session handling and display. - Added context management for agent conversations to improve state persistence across sessions.
This commit is contained in:
@@ -176,7 +176,16 @@ const sendMsg = (value: string) => {
|
||||
};
|
||||
|
||||
const getTitle = (session_id: string, value: string) => {
|
||||
let obj = { title: '新会话', path: `chat/${kbId.value}/${session_id}`, id: session_id, isMore: false, isNoTitle: true };
|
||||
const now = new Date().toISOString();
|
||||
let obj = {
|
||||
title: '新会话',
|
||||
path: `chat/${kbId.value}/${session_id}`,
|
||||
id: session_id,
|
||||
isMore: false,
|
||||
isNoTitle: true,
|
||||
created_at: now,
|
||||
updated_at: now
|
||||
};
|
||||
usemenuStore.updataMenuChildren(obj);
|
||||
usemenuStore.changeIsFirstSession(true);
|
||||
usemenuStore.changeFirstQuery(value);
|
||||
|
||||
Reference in New Issue
Block a user