From a562564e8810e815ed247ff5e08d2d64f0d94a33 Mon Sep 17 00:00:00 2001 From: lkddi Date: Fri, 6 Mar 2026 03:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9AAI=20=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E4=B8=8A=E4=B8=8B=E6=96=87=E8=BD=AE=E6=95=B0=E4=BB=8E?= =?UTF-8?q?=2010=20=E9=99=8D=E8=87=B3=204=EF=BC=8C=E5=87=8F=E5=B0=91=20tok?= =?UTF-8?q?en=20=E8=BE=93=E5=85=A5=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/AiChatService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Services/AiChatService.php b/app/Services/AiChatService.php index d457732..87e3984 100644 --- a/app/Services/AiChatService.php +++ b/app/Services/AiChatService.php @@ -26,8 +26,10 @@ class AiChatService { /** * 每个用户保留的最大对话轮数 + * + * 设置较小值可减少 token 输入量,加快本地 Ollama CPU 推理速度。 */ - private const MAX_CONTEXT_ROUNDS = 10; + private const MAX_CONTEXT_ROUNDS = 4; /** * AI 请求超时时间(秒)