fix issues

This commit is contained in:
2026-07-29 10:38:19 +08:00
parent abf84e1081
commit f3faa36e99
4 changed files with 34 additions and 10 deletions

View File

@@ -171,7 +171,11 @@ function handleAIResult(aiResult, roomId, username, originalText, attachments) {
broadcastToRoom(roomId, { type: 'query_pending', text: '🔍 正在查询采购数据,请稍候...' });
const purchaseData = db.prepare('SELECT item, amount, payment_method, status, created_at FROM purchases WHERE room_id = ? ORDER BY created_at DESC').all(roomId).map(p => p.created_at + ' ' + p.item + ' ¥' + p.amount + ' ' + (p.payment_method||'') + ' ' + p.status).join('\n');
const summaryPrompt = '根据以下采购记录,用自然语言回答用户查询"' + originalText + '"。采购记录:\n' + (purchaseData || '暂无记录');
callDeepSeekForSummary(summaryPrompt, username).then(reply => { storeAndBroadcastText(roomId, '小财', reply); addToHistory(roomId, 'assistant', reply); });
callDeepSeekForSummary(summaryPrompt, username).then(function(reply) {
console.log('🤖 Query汇总回复:', reply.substring(0, 200));
storeAndBroadcastText(roomId, '小财', reply);
addToHistory(roomId, 'assistant', reply);
});
return;
}