优化:AI 对话上下文轮数从 10 降至 4,减少 token 输入量

This commit is contained in:
2026-03-06 03:40:26 +08:00
parent ca639ddd37
commit a562564e88

View File

@@ -26,8 +26,10 @@ class AiChatService
{
/**
* 每个用户保留的最大对话轮数
*
* 设置较小值可减少 token 输入量,加快本地 Ollama CPU 推理速度。
*/
private const MAX_CONTEXT_ROUNDS = 10;
private const MAX_CONTEXT_ROUNDS = 4;
/**
* AI 请求超时时间(秒)