From 15a78b19ad49674c8b94c9a02141cf0c0965f7e0 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 11 Apr 2024 19:21:08 +0530 Subject: [PATCH] Improve Inferred Document Search Query Extraction from GPT Using stop_words = "\n" was preventing JSON responses with newlines in them --- src/khoj/processor/conversation/openai/gpt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/processor/conversation/openai/gpt.py b/src/khoj/processor/conversation/openai/gpt.py index 775eccf3..e30ad5d5 100644 --- a/src/khoj/processor/conversation/openai/gpt.py +++ b/src/khoj/processor/conversation/openai/gpt.py @@ -67,7 +67,7 @@ def extract_questions( model_name=model, temperature=temperature, max_tokens=max_tokens, - model_kwargs={"stop": ["A: ", "\n"], "response_format": {"type": "json_object"}}, + model_kwargs={"response_format": {"type": "json_object"}}, openai_api_key=api_key, )