mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-10 18:02:55 +00:00
feat: AI 助手增加最大响应数至50,并添加上下文窗口大小设置
This commit is contained in:
parent
5ad08d8d36
commit
6a3e3c3753
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user