From 4395ed8065364d0cc8a5c5ba5b00b1330d42680b Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 26 Apr 2024 11:38:46 +0530 Subject: [PATCH] Improve extract_questions func. Set message role to user, not assistant Previous behavior of passing message with role = "assistant was reducing instruction following quality of the model --- 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 c4bcd265..6fb0ca0f 100644 --- a/src/khoj/processor/conversation/openai/gpt.py +++ b/src/khoj/processor/conversation/openai/gpt.py @@ -59,7 +59,7 @@ def extract_questions( yesterday_date=(today - timedelta(days=1)).strftime("%Y-%m-%d"), location=location, ) - messages = [ChatMessage(content=prompt, role="assistant")] + messages = [ChatMessage(content=prompt, role="user")] # Get Response from GPT response = completion_with_backoff(