优化缓存命中
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
// AI Prompt 模板 — 模块化拼接
|
||||
function buildSystemPrompt(username, isAdmin) {
|
||||
const now = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai', hour12: false });
|
||||
|
||||
// 稳定前缀放前面(提升缓存命中率)
|
||||
const role = '你是智能财务助手"小财"。结合对话历史理解用户意图,只返回JSON。';
|
||||
|
||||
const intent = [
|
||||
@@ -69,10 +66,7 @@ function buildSystemPrompt(username, isAdmin) {
|
||||
'- 无法确定物品名 → action="ask" 追问'
|
||||
].join('\n');
|
||||
|
||||
// 变动的放最后
|
||||
const timeInfo = '当前服务器时间:' + now;
|
||||
|
||||
return [role, intent, permission, deleteRules, attachmentRules, prohibitionRules, modifyGuide, purchaseRules, timeInfo].join('\n');
|
||||
return [role, intent, permission, deleteRules, attachmentRules, prohibitionRules, modifyGuide, purchaseRules].join('\n');
|
||||
}
|
||||
|
||||
module.exports = { buildSystemPrompt };
|
||||
|
||||
Reference in New Issue
Block a user