diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ba50d559..3f338527 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -15,6 +15,7 @@ "marked": "^5.1.2", "pagefind": "^1.1.1", "pinia": "^3.0.1", + "swiper": "^12.0.3", "tdesign-icons-vue-next": "^0.4.1", "tdesign-vue-next": "^1.17.2", "vue": "^3.5.13", @@ -3392,6 +3393,25 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/swiper": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/swiper/-/swiper-12.0.3.tgz", + "integrity": "sha512-BHd6U1VPEIksrXlyXjMmRWO0onmdNPaTAFduzqR3pgjvi7KfmUCAm/0cj49u2D7B0zNjMw02TSeXfinC1hDCXg==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/swiperjs" + }, + { + "type": "open_collective", + "url": "http://opencollective.com/swiper" + } + ], + "license": "MIT", + "engines": { + "node": ">= 4.7.0" + } + }, "node_modules/tapable": { "version": "2.2.2", "resolved": "https://mirrors.tencent.com/npm/tapable/-/tapable-2.2.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index ec41f3a9..6a5a4259 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,6 +19,7 @@ "marked": "^5.1.2", "pagefind": "^1.1.1", "pinia": "^3.0.1", + "swiper": "^12.0.3", "tdesign-icons-vue-next": "^0.4.1", "tdesign-vue-next": "^1.17.2", "vue": "^3.5.13", diff --git a/frontend/src/api/chat/streame.ts b/frontend/src/api/chat/streame.ts index e82b1fc0..54e5c37e 100644 --- a/frontend/src/api/chat/streame.ts +++ b/frontend/src/api/chat/streame.ts @@ -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[]; agent_enabled?: boolean; method: string; url: string }) => { + const startStream = async (params: { session_id: any; query: any; knowledge_base_ids?: string[]; agent_enabled?: boolean; summary_model_id?: string; method: string; url: string }) => { // 重置状态 output.value = ''; error.value = null; @@ -69,6 +69,10 @@ export function useStream() { if (params.knowledge_base_ids !== undefined && params.knowledge_base_ids.length > 0) { postBody.knowledge_base_ids = params.knowledge_base_ids; } + // Include summary_model_id if provided (for non-Agent mode) + if (params.summary_model_id) { + postBody.summary_model_id = params.summary_model_id; + } await fetchEventSource(url, { method: params.method, diff --git a/frontend/src/api/model/index.ts b/frontend/src/api/model/index.ts index e01b0755..16f42cd5 100644 --- a/frontend/src/api/model/index.ts +++ b/frontend/src/api/model/index.ts @@ -16,6 +16,7 @@ export interface ModelConfig { truncate_prompt_tokens?: number; }; interface_type?: 'ollama' | 'openai'; // VLLM专用 + parameter_size?: string; // Ollama模型参数大小 (e.g., "7B", "13B", "70B") }; is_default?: boolean; status?: string; diff --git a/frontend/src/assets/img/Frame3718.svg b/frontend/src/assets/img/Frame3718.svg index 16de2d9b..cafde74c 100644 --- a/frontend/src/assets/img/Frame3718.svg +++ b/frontend/src/assets/img/Frame3718.svg @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/frontend/src/assets/img/agent.svg b/frontend/src/assets/img/agent.svg index fd134d36..458f55da 100644 --- a/frontend/src/assets/img/agent.svg +++ b/frontend/src/assets/img/agent.svg @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/frontend/src/assets/img/screenshot-1.svg b/frontend/src/assets/img/screenshot-1.svg new file mode 100644 index 00000000..1ca5d27f --- /dev/null +++ b/frontend/src/assets/img/screenshot-1.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + 智能文档检索 + 多模态文档解析 • 语义理解 • 精准检索 + + + + + + + + 输入查询内容进行智能检索... + + + + 检索 + + + + + + + + + + + + + + + RAG系统技术文档.pdf + 详细介绍了检索增强生成的核心原理和实现方案... + 3.2 MB • 127页 • 2024-01-20 + + + + + + + + + + + + + + 向量检索优化方案.docx + 基于Embedding的语义检索技术实践与优化... + 1.8 MB • 45页 • 2024-01-19 + + + + + + + + + + + + + + + 知识图谱架构图.png + 展示知识图谱的节点关系和查询路径... + 1.2 MB • 1920×1080 • 2024-01-18 + + + diff --git a/frontend/src/assets/img/screenshot-2.svg b/frontend/src/assets/img/screenshot-2.svg new file mode 100644 index 00000000..ec4d50c4 --- /dev/null +++ b/frontend/src/assets/img/screenshot-2.svg @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + 混合检索策略 + BM25 关键词 + 向量语义 + 知识图谱 + + + + + + + BM25 + + + + + K + + + + 关键词匹配 + + + + TF-IDF 权重 + + + + + 词频统计 + + + + + 精确匹配 + + + + + + + + 向量检索 + + + + + + + + + + + + + + + + + + + + + + + 语义理解 + + + + Embedding + + + + + 余弦相似度 + + + + + ANN 检索 + + + + + + + + 知识图谱 + + + + + + + + + + + + + + + + + + + 关系推理 + + + + 实体识别 + + + + + 路径查询 + + + + + 子图匹配 + + + + + + + + + + + + 融合排序 → 最优结果 + + + + + + + + + diff --git a/frontend/src/assets/img/screenshot-4.svg b/frontend/src/assets/img/screenshot-4.svg new file mode 100644 index 00000000..8c02d790 --- /dev/null +++ b/frontend/src/assets/img/screenshot-4.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + Agentic RAG + 基于 ReAct 范式的智能检索代理 + + + + + 用户问题 + + + + + + + + + ReAct 循环 + + + + + ① Reasoning + 分析问题 + 规划行动策略 + + + + + + + + + ② Acting (Tools) + + + + + + 🔍 向量检索 + + + + + + + 🔗 知识图谱 + + + + + + + 📊 BM25检索 + + + + + + 迭代优化 + + + + + + + + + ③ 生成增强答案 + + + + + 特点: + • 自主推理 + • 工具调用 + • 动态迭代 + + + + + + + + + + + + diff --git a/frontend/src/assets/img/zhishiku-thin.svg b/frontend/src/assets/img/zhishiku-thin.svg new file mode 100644 index 00000000..208b0a7f --- /dev/null +++ b/frontend/src/assets/img/zhishiku-thin.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/src/assets/img/ziliao.svg b/frontend/src/assets/img/ziliao.svg index b1338f3e..ab3242e0 100644 --- a/frontend/src/assets/img/ziliao.svg +++ b/frontend/src/assets/img/ziliao.svg @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/frontend/src/components/Input-field.vue b/frontend/src/components/Input-field.vue index 4b7c7b89..3a94e2da 100644 --- a/frontend/src/components/Input-field.vue +++ b/frontend/src/components/Input-field.vue @@ -1,13 +1,14 @@
+ +
+ Thinking: + {{ thinkingModelName || '未配置' }} +
+ + +
+ + {{ selectedModel ? selectedModel.name : '模型' }} + + + + +
+ + + +
+
+
+
+
+ {{ model.name }} + 远程 + + {{ model.parameters.parameter_size }} + +
+
+ {{ model.description }} +
+
+
+ 暂无可用模型 +
+
+
+
+
+
@@ -665,4 +963,165 @@ const getImgSrc = (url: string) => { height: 16px; } } + +/* 模型显示样式 */ +.model-display { + display: flex; + align-items: center; + margin-left: 8px; + flex-shrink: 0; +} + +.model-badge { + display: flex; + align-items: center; + gap: 4px; + padding: 4px 10px; + background: rgba(7, 192, 95, 0.08); + border-radius: 6px; + font-size: 12px; + white-space: nowrap; +} + +.model-label { + color: #666; + font-weight: 500; +} + +.model-name { + color: #07C05F; + font-weight: 600; +} + +.model-btn { + height: 28px; + padding: 0 10px; + min-width: auto; + + &.active { + background: rgba(7, 192, 95, 0.1); + color: #07C05F; + + &:hover { + background: rgba(7, 192, 95, 0.15); + } + } +} + +.model-btn-text { + font-size: 13px; + color: #666; + font-weight: 500; + white-space: nowrap; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; +} + +.model-btn.active .model-btn-text { + color: #07C05F; +} + +/* 模型选择下拉菜单 */ +.model-selector-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 9998; +} + +.model-selector-dropdown { + z-index: 9999; + background: white; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + max-width: 350px; + max-height: 400px; + overflow: hidden; +} + +.model-selector-content { + max-height: 400px; + overflow-y: auto; +} + +.model-option { + padding: 12px 16px; + cursor: pointer; + transition: background 0.2s; + border-bottom: 1px solid #f0f0f0; + + &:last-child { + border-bottom: none; + } + + &:hover { + background: #f5f5f5; + } + + &.selected { + background: rgba(7, 192, 95, 0.08); + + .model-option-name { + color: #07C05F; + font-weight: 600; + } + } + + &.empty { + color: #999; + cursor: default; + text-align: center; + + &:hover { + background: white; + } + } +} + +.model-option-main { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 4px; +} + +.model-option-name { + font-size: 14px; + color: #333; + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.model-option-desc { + font-size: 12px; + color: #999; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.model-badge-remote, +.model-badge-local { + display: inline-block; + padding: 2px 6px; + font-size: 11px; + border-radius: 3px; + font-weight: 500; + flex-shrink: 0; +} + +.model-badge-remote { + background: rgba(7, 192, 95, 0.1); + color: #07C05F; +} + +.model-badge-local { + background: rgba(82, 196, 26, 0.1); + color: #52c41a; +} diff --git a/frontend/src/types/tool-results.ts b/frontend/src/types/tool-results.ts index fee4b853..01f131e2 100644 --- a/frontend/src/types/tool-results.ts +++ b/frontend/src/types/tool-results.ts @@ -115,7 +115,7 @@ export interface ThinkingData { export interface PlanStep { id: string; description: string; - tools_to_use?: string; + tools_to_use?: string[]; // Changed from string to array status: 'pending' | 'in_progress' | 'completed' | 'skipped'; } diff --git a/frontend/src/views/auth/Login.vue b/frontend/src/views/auth/Login.vue index efd2e926..72fa3e78 100644 --- a/frontend/src/views/auth/Login.vue +++ b/frontend/src/views/auth/Login.vue @@ -1,16 +1,281 @@ \ No newline at end of file + +/* Responsive Design */ +@media (max-width: 1024px) { + .showcase-subtitle { + font-size: 18px; + } + + .header-logo { + top: 26px; + left: 40px; + + .logo-image { + width: 100px; + } + } + + .header-links { + top: 22px; + right: 22px; + gap: 8px; + + .link-text { + display: none; + } + + .header-link { + padding: 10px; + gap: 0; + } + } +} + +@media (max-width: 768px) { + .login-layout { + flex-direction: column; + } + + .showcase-section { + flex: 0 0 auto; + min-height: 50vh; + padding: 40px 24px; + } + + .showcase-content { + max-width: 100%; + } + + .header-logo { + top: 22px; + left: 30px; + + .logo-image { + width: 80px; + } + } + + .showcase-subtitle { + font-size: 16px; + margin-bottom: 24px; + } + + .feature-tags { + margin-bottom: 24px; + } + + .carousel-container { + margin-top: 24px; + } + + .form-section { + flex: 0 0 auto; + padding: 24px; + } + + .header-links { + top: 18px; + right: 18px; + gap: 8px; + + .link-text { + display: inline; + } + + .header-link { + padding: 8px 12px; + font-size: 12px; + } + } + + .form-card { + padding: 32px 24px; + } + + .form-title { + font-size: 22px; + } +} + +@media (max-width: 480px) { + .showcase-section { + padding: 32px 20px; + } + + .header-logo { + top: 18px; + left: 20px; + + .logo-image { + width: 70px; + } + } + + .showcase-subtitle { + font-size: 14px; + } + + .tag { + font-size: 12px; + padding: 6px 16px; + } + + .form-section { + padding: 20px; + } + + .header-links { + top: 14px; + right: 14px; + gap: 6px; + flex-wrap: wrap; + + .header-link { + padding: 7px 10px; + font-size: 11px; + } + } + + .form-card { + padding: 28px 20px; + } + + .form-header { + margin-bottom: 24px; + } +} + diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.vue b/frontend/src/views/chat/components/AgentStreamDisplay.vue index c076c82a..9e305bda 100644 --- a/frontend/src/views/chat/components/AgentStreamDisplay.vue +++ b/frontend/src/views/chat/components/AgentStreamDisplay.vue @@ -2,16 +2,30 @@
-
- {{ showIntermediateSteps ? '▼' : '▶' }} - - {{ intermediateStepsCount }} intermediate step{{ intermediateStepsCount !== 1 ? 's' : '' }} (click to {{ showIntermediateSteps ? 'collapse' : 'expand' }}) - +
+
+
+ + {{ intermediateStepsSummary }} +
+
+ +
+