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 = [