feat: 支持在消息流中展示@的知识库和文件

This commit is contained in:
wizardchen
2025-12-22 11:49:58 +08:00
committed by lyingbug
parent 3c83cf9873
commit 58ae0d8350
10 changed files with 219 additions and 26 deletions
+5 -1
View File
@@ -28,7 +28,7 @@ export function useStream() {
let renderTimer: number | null = null
// 启动流式请求
const startStream = async (params: { session_id: any; query: any; knowledge_base_ids?: string[]; knowledge_ids?: string[]; agent_enabled?: boolean; web_search_enabled?: boolean; summary_model_id?: string; mcp_service_ids?: string[]; method: string; url: string }) => {
const startStream = async (params: { session_id: any; query: any; knowledge_base_ids?: string[]; knowledge_ids?: string[]; agent_enabled?: boolean; web_search_enabled?: boolean; summary_model_id?: string; mcp_service_ids?: string[]; mentioned_items?: Array<{id: string; name: string; type: string; kb_type?: string}>; method: string; url: string }) => {
// 重置状态
output.value = '';
error.value = null;
@@ -101,6 +101,10 @@ export function useStream() {
if (params.mcp_service_ids !== undefined && params.mcp_service_ids.length > 0) {
postBody.mcp_service_ids = params.mcp_service_ids;
}
// Include mentioned_items if provided (for displaying @mentions in chat)
if (params.mentioned_items !== undefined && params.mentioned_items.length > 0) {
postBody.mentioned_items = params.mentioned_items;
}
await fetchEventSource(url, {
method: params.method,