From 31dcc44c2030b285ea939638d8fda2bdfcf2e318 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Sun, 18 May 2025 14:40:57 -0700 Subject: [PATCH] Output tokens >> reasoning tokens to avoid early response termination. --- src/khoj/processor/conversation/google/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/khoj/processor/conversation/google/utils.py b/src/khoj/processor/conversation/google/utils.py index c527bf72..22cd8d0f 100644 --- a/src/khoj/processor/conversation/google/utils.py +++ b/src/khoj/processor/conversation/google/utils.py @@ -36,7 +36,9 @@ logger = logging.getLogger(__name__) gemini_clients: Dict[str, genai.Client] = {} -MAX_OUTPUT_TOKENS_GEMINI = 8192 +# Output tokens should be more than reasoning tokens. +# This avoids premature response termination. +MAX_OUTPUT_TOKENS_GEMINI = 20000 MAX_REASONING_TOKENS_GEMINI = 10000 SAFETY_SETTINGS = [