feat: Agent 预设系统 - 一键切换角色/工作模式

- 内置 6 个预设:默认、翻译官、代码审查、写作助手、数据分析师、学习导师
- 每个预设包含:系统提示词、温度、上下文长度、Think 开关
- 预设栏胶囊按钮,点击即切换,自动应用全部配置
- 支持创建/编辑/删除自定义预设,IndexedDB 持久化
- 切换预设时同步设置面板 UI + toast 提示
- 温度参数集成到聊天 API 调用
This commit is contained in:
thzxx
2026-04-05 19:55:45 +08:00
parent 2c475c0c8c
commit bc63ba9611
6 changed files with 752 additions and 1 deletions
+3 -1
View File
@@ -402,12 +402,14 @@ export async function sendMessage() {
try {
const apiMessages = buildApiMessages(freshSession.messages);
const temperature = state.get('temperature', 0.7);
const chatParams = {
model,
messages: apiMessages,
think: thinkMode,
...(systemPromptEnabled && systemPrompt && { system: systemPrompt }),
...(numCtx && { options: { num_ctx: numCtx } })
...(numCtx && { options: { num_ctx: numCtx, temperature } })
};
// RAG 检索增强