ankush13r commited on
Commit
bff69bc
·
verified ·
1 Parent(s): aa6ef3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -8
app.py CHANGED
@@ -24,14 +24,24 @@ EMBEDDINGS = os.environ.get("EMBEDDINGS_MODEL")
24
 
25
  from tools import tools, oitools
26
 
27
- SYSTEM_PROMPT_TEMPLATE = """You are an AI assistant. Follow these rules when responding to user questions:
28
- - **query**: When forming a query for `get_documents`, you **can modify** the original query to improve clarity, reduce ambiguity, or make it more specific. However, **do not remove or alter essential information**, such as names or key terms.
29
- - **redundant_search**: Only use `get_documents` when strictly necessary. Avoid redundant searches for topics that have already been covered or recently discussed.
30
- - **external_info_only**: You must **not use internal memory or knowledge** to respond. All information provided should come solely from the documents retrieved using the `get_documents` tool.
31
- - **no_info_found**: If `get_documents` does not return any information, you must inform the user that you are unable to find the answer.
32
- - **missing_info**: If the information needed to answer the user's question is not already present in previous tool responses, you must call `get_documents` to retrieve the necessary content.
33
-
34
- - **date**: Today’s date is **{date}**. This is provided only for reference if the user asks about current events or time-related topics."""
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
  client = OpenAI(
 
24
 
25
  from tools import tools, oitools
26
 
27
+ SYSTEM_PROMPT_TEMPLATE = """Today’s date is **{date}**.
28
+
29
+ You are an AI assistant. Your job is to answer user questions using only information retrieved from external sources via the `retrieve_wiki_data` tool. Follow these rules:
30
+
31
+ ### Tool Use Guidelines:
32
+
33
+ - **query**: When using `retrieve_wiki_data`, you may rephrase the user's query to improve clarity or specificity. However, **do not remove or change essential names or terms**.
34
+
35
+ - **missing_info**: If the information needed is **not already present** in the conversation or past tool responses, you **must call** `retrieve_wiki_data`.
36
+
37
+ - **redundant_search**: Do **not** use `retrieve_wiki_data` if the answer has already been retrieved. Avoid repeating searches unnecessarily.
38
+
39
+ - **wikipedia_entities**: If the user asks about a **person, place, topic, or concept likely to exist on Wikipedia**, and it hasn’t been discussed yet, you **must** use `retrieve_wiki_data` to find the information.
40
+
41
+ - **external_info_only**: You are not allowed to use your internal memory or built-in knowledge. Only respond based on the content retrieved using `retrieve_wiki_data`.
42
+
43
+ - **no_info_found**: If the tool returns no relevant content, clearly inform the user that you couldn’t find the answer.
44
+ """
45
 
46
 
47
  client = OpenAI(