From 365d71080618262cb9b3f178893ccded676022e1 Mon Sep 17 00:00:00 2001 From: busya Date: Fri, 15 May 2026 09:46:37 +0300 Subject: [PATCH] =?UTF-8?q?fix(translate):=20increase=20max=5Ftokens=20409?= =?UTF-8?q?6=E2=86=928192=20for=20DeepSeek=20multi-language=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit finish_reason=length from DeepSeek v4 Flash — model runs out of output tokens due to reasoning_content (CoT) + multi-language (4 langs). 8192 tokens ensures complete JSON response for preview and execution. --- backend/src/plugins/translate/executor.py | 2 +- backend/src/plugins/translate/preview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/translate/executor.py b/backend/src/plugins/translate/executor.py index 252ca9be..fc9edaa0 100644 --- a/backend/src/plugins/translate/executor.py +++ b/backend/src/plugins/translate/executor.py @@ -946,7 +946,7 @@ class TranslationExecutor: {"role": "user", "content": prompt}, ], "temperature": 0.1, - "max_tokens": 4096, + "max_tokens": 8192, } # Structured output (response_format) only for native OpenAI — upstream providers routed via # Kilo/OpenRouter may not support it (e.g. StepFun returns "structured_outputs is not supported") diff --git a/backend/src/plugins/translate/preview.py b/backend/src/plugins/translate/preview.py index 1ecc37e7..5a279a57 100644 --- a/backend/src/plugins/translate/preview.py +++ b/backend/src/plugins/translate/preview.py @@ -952,7 +952,7 @@ class TranslationPreview: {"role": "user", "content": prompt}, ], "temperature": 0.1, - "max_tokens": 4096, + "max_tokens": 8192, } # Structured output (response_format) only for native OpenAI — upstream providers routed via # Kilo/OpenRouter may not support it (e.g. StepFun returns "structured_outputs is not supported")