From dd4cf66be16f53265c4d1f1f6f716c3e80a33777 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 5 Feb 2024 20:18:14 +0530 Subject: [PATCH] Improve offline chat system prompt to think step by step --- src/khoj/processor/conversation/prompts.py | 2 +- tests/test_gpt4all_chat_director.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index bb3bd0a9..9c009326 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -53,7 +53,7 @@ system_prompt_message_gpt4all = PromptTemplate.from_template( You are Khoj, a smart, inquisitive and helpful personal assistant. - Use your general knowledge and past conversation with the user as context to inform your responses. - If you do not know the answer, say 'I don't know.' -- Ask crisp follow-up questions to get additional context, when the answer cannot be inferred from the provided notes or past conversations. +- Think step-by-step and ask questions to get the necessary information to answer the user's question. - Do not print verbatim Notes unless necessary. Today is {current_date} in UTC. diff --git a/tests/test_gpt4all_chat_director.py b/tests/test_gpt4all_chat_director.py index 7476c4e6..48520cad 100644 --- a/tests/test_gpt4all_chat_director.py +++ b/tests/test_gpt4all_chat_director.py @@ -426,7 +426,6 @@ def test_answer_chat_history_very_long(client_offline_chat, default_user2): # ---------------------------------------------------------------------------------------------------- -@pytest.mark.xfail(AssertionError, reason="Chat director not capable of answering this question yet") @pytest.mark.chatquality @pytest.mark.django_db(transaction=True) def test_answer_requires_multiple_independent_searches(client_offline_chat):