feat: AI 助手增加最大响应数至50,并添加上下文窗口大小设置

This commit is contained in:
kuaifan 2025-11-12 01:23:34 +00:00
parent 5ad08d8d36
commit 6a3e3c3753

View File

@ -131,7 +131,8 @@ export default {
//
responses: [],
responseSeed: 1,
maxResponses: 5,
maxResponses: 50,
contextWindowSize: 10,
activeSSEClients: [],
}
},
@ -416,7 +417,11 @@ export default {
context.push([role, content]);
};
const context = [];
this.responses.forEach(item => {
const windowSize = Number(this.contextWindowSize) || 0;
const recentResponses = windowSize > 0
? this.responses.slice(-windowSize)
: this.responses;
recentResponses.forEach(item => {
if (item.prompt) {
pushEntry(context, 'human', item.prompt);
}