feat: 统一系统提示词并优化智能体选择器界面

- 将系统提示词从分离的网络搜索开/关状态合并为统一提示词,使用 {{web_search_status}} 占位符动态控制行为
- 重构智能体选择器,从简单tooltip升级为内容丰富的popup,显示智能体详细信息、类型和能力
- 新增FAQ优先策略配置,支持FAQ答案优先于普通文档
- 优化知识库选择逻辑,智能体切换时自动同步配置的知识库
- 更新相关接口类型定义和国际化文本
This commit is contained in:
wizardchen
2025-12-28 21:46:42 +08:00
parent c9e482eb79
commit 6bc19ab082
21 changed files with 1198 additions and 609 deletions
+8 -4
View File
@@ -22,8 +22,7 @@ interface AgentConfig {
maxIterations: number;
temperature: number;
allowedTools: string[];
system_prompt_web_enabled?: string;
system_prompt_web_disabled?: string;
system_prompt?: string; // Unified system prompt (uses {{web_search_status}} placeholder)
}
interface ConversationModels {
@@ -69,8 +68,7 @@ const defaultSettings: Settings = {
maxIterations: 5,
temperature: 0.7,
allowedTools: [], // 默认为空,需要通过 API 从后端加载
system_prompt_web_enabled: "",
system_prompt_web_disabled: "",
system_prompt: "",
},
selectedKnowledgeBases: [], // 默认为空数组
selectedFiles: [], // 默认为空数组
@@ -326,6 +324,12 @@ export const useSettingsStore = defineStore("settings", {
this.settings.isAgentEnabled = true;
}
// 自定义智能体需要根据其配置来决定
// 切换智能体时重置知识库和文件选择状态
// 因为不同智能体关联的知识库不同,需要清空用户之前的选择
this.settings.selectedKnowledgeBases = [];
this.settings.selectedFiles = [];
localStorage.setItem("WeKnora_settings", JSON.stringify(this.settings));
},