Improve doc search actor performance on vague, random or meta questions

- Issue
  Previously the doc search actor wouldn't extract good search queries
  to run on user's documents for broad, vague questions.

- Fix
  The updated extract questions prompt shows and tells the doc search
  actor on how to deal with such questions

  The doc search actor's temperature was also increased to support more
  creative/random questions. The previous temp of 0 was meant to
  encourage structured json output. But now with json mode, a low temp is
  not necessary to get json output
This commit is contained in:
Debanjum Singh Solanky
2024-07-27 01:33:36 +05:30
parent 3675938df6
commit f75606d7f5
4 changed files with 21 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ def extract_questions(
conversation_log={},
api_key=None,
api_base_url=None,
temperature=0,
temperature=0.7,
max_tokens=100,
location_data: LocationData = None,
user: KhojUser = None,
@@ -52,6 +52,7 @@ def extract_questions(
prompt = prompts.extract_questions.format(
current_date=today.strftime("%Y-%m-%d"),
day_of_week=today.strftime("%A"),
current_month=today.strftime("%Y-%m"),
last_new_year=last_new_year.strftime("%Y"),
last_new_year_date=last_new_year.strftime("%Y-%m-%d"),
current_new_year_date=current_new_year.strftime("%Y-%m-%d"),