优化prmpt
This commit is contained in:
@@ -7,7 +7,7 @@ const { broadcastToRoom } = require('./ws');
|
||||
// 对话历史(内存)
|
||||
const conversationHistory = new Map();
|
||||
function getHistory(roomId) { if (!conversationHistory.has(roomId)) conversationHistory.set(roomId, []); return conversationHistory.get(roomId); }
|
||||
function addToHistory(roomId, role, content) { var h = getHistory(roomId); h.push({ role: role, content: content }); if (h.length > 60) conversationHistory.set(roomId, h.slice(-30)); }
|
||||
function addToHistory(roomId, role, content) { var h = getHistory(roomId); h.push({ role: role, content: content }); if (h.length > 16) conversationHistory.set(roomId, h.slice(-8)); }
|
||||
|
||||
// 待处理操作
|
||||
const pendingActions = new Map();
|
||||
|
||||
Reference in New Issue
Block a user