From 8aa9c0f5345bea66fd8d89bec8cc82ea49ea446a Mon Sep 17 00:00:00 2001 From: Debanjum Date: Fri, 22 Aug 2025 18:57:38 -0700 Subject: [PATCH] Reduce max reasoning tokens for gemini models A high reasoning tokens does not seem to help for standard Khoj use cases. And hopefully reducing it may avoid repetition loops by model. --- src/khoj/processor/conversation/google/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/processor/conversation/google/utils.py b/src/khoj/processor/conversation/google/utils.py index 3a64434c..b6d965e4 100644 --- a/src/khoj/processor/conversation/google/utils.py +++ b/src/khoj/processor/conversation/google/utils.py @@ -46,7 +46,7 @@ gemini_clients: Dict[str, genai.Client] = {} # This avoids premature response termination. MAX_OUTPUT_TOKENS_FOR_REASONING_GEMINI = 20000 MAX_OUTPUT_TOKENS_FOR_STANDARD_GEMINI = 8000 -MAX_REASONING_TOKENS_GEMINI = 10000 +MAX_REASONING_TOKENS_GEMINI = 512 SAFETY_SETTINGS = [ gtypes.SafetySetting(