Skip to content

Commit

Permalink
Search: update prompt to enfore valid JSON in response
Browse files Browse the repository at this point in the history
  • Loading branch information
YuraLukashik committed Nov 6, 2023
1 parent 26e1f6e commit 44692d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/semantic_search/semantic_search/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ def smart_query(namespace, query, username: str):
"Be as clear and short as possible and don't use any introductionary words. Omit phrases like, "
"\"Based on the messages found.\" Exclude search queries and questions from the messages. Rely on "
"positive statements.\n\n"
"The output should be a valid JSON object (don't include any surrounding text) with "
"The output MUST be a valid JSON object (don't include any surrounding text) with "
"the following schema:\n"
"{\n"
" \"messages_explain\": \"List out all message objects from the JSON above that relate to the query."
"Describe how each message in this list relates to the query in detail. Use a separate field for that. "
"Exclude search queries and Haly/Haly Master mentions from this list. Rely on positive statements.\",\n"
"Exclude search queries and Haly/Haly Master mentions from this list. Rely on positive statements. "
"Make sure you include correct JSON objects.\",\n"
" \"explain\": \"Think through the messages in the messages_explain field above and infer the "
"answer to the query. Use strong deduction and explain the conclusion. Be as concise as possible.\",\n"
" \"answer\": \"Based on the explain and messages_explain fields, generate a short and concise "
Expand Down

0 comments on commit 44692d0

Please sign in to comment.