mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-26 20:48:12 +00:00
refactor(ai): 优化 AI 提示词构建逻辑
- withLanguagePreferencePrompt: 修复无语言标签时占位符未添加的问题 - handleBeforeSend: 简化操作会话提示词,移除冗余的工具名称说明 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2180998e81
commit
cb5e7e2cc7
@ -405,7 +405,7 @@ export default {
|
||||
// 添加操作会话信息
|
||||
let operationContext = '';
|
||||
if (this.operationSessionId) {
|
||||
operationContext = `\n\n前端操作会话已建立,session_id: ${this.operationSessionId}。你可以使用 get_page_context、execute_action、execute_element_action 工具直接操作用户的页面。`;
|
||||
operationContext = `\n\n页面操作会话 session_id: ${this.operationSessionId}。`;
|
||||
}
|
||||
|
||||
const prepared = [
|
||||
|
||||
6
resources/assets/js/utils/ai.js
vendored
6
resources/assets/js/utils/ai.js
vendored
@ -360,10 +360,8 @@ const withLanguagePreferencePrompt = (prompt) => {
|
||||
return prompt;
|
||||
}
|
||||
const label = languageList[languageName] || languageName || '';
|
||||
if (!label) {
|
||||
return prompt;
|
||||
}
|
||||
return `${prompt}\n\n${LANGUAGE_PREFERENCE_PROMPT(label)}\n\n${SYSTEM_OPTIONAL_PROMPTS_PLACEHOLDER}`;
|
||||
const languagePart = label ? `\n\n${LANGUAGE_PREFERENCE_PROMPT(label)}` : '';
|
||||
return `${prompt}${languagePart}\n\n${SYSTEM_OPTIONAL_PROMPTS_PLACEHOLDER}`;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user