feat: Agent 预设系统 - 一键切换角色/工作模式
- 内置 6 个预设:默认、翻译官、代码审查、写作助手、数据分析师、学习导师 - 每个预设包含:系统提示词、温度、上下文长度、Think 开关 - 预设栏胶囊按钮,点击即切换,自动应用全部配置 - 支持创建/编辑/删除自定义预设,IndexedDB 持久化 - 切换预设时同步设置面板 UI + toast 提示 - 温度参数集成到聊天 API 调用
This commit is contained in:
@@ -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 检索增强
|
||||
|
||||
Reference in New Issue
Block a user