umaiku commited on
Commit
6045274
·
verified ·
1 Parent(s): 2b71ebc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -96,18 +96,18 @@ def respond(
96
  #print("# Case url: " + doc.metadata["case_url"] + spacer)
97
 
98
  system_message += f"""
99
- A user is asking you a question in his own language.
 
 
 
 
100
  # Task:
101
- If the user is not asking a legal question and it does not require any context, just answer the user in his own language and DO NOT user the provided context.
102
- Otherwise, if it's a question related to legal matters, please answer the user in the same language that he used in his question using ONLY the following given context not any prior knowledge or information found on the internet.
103
  If the retrieved context is not relevant cases or the issue has not been addressed within the context, just say "I can't find enough relevant information".
104
  Don't make up an answer or give irrelevant information not requested by the user.
105
  Otherwise, if relevant cases were found, answer in the user's question's language using the context that you found relevant and reference the sources, including the urls and dates.
106
  # Instructions:
107
- Always answer the user using the language used in his question.
108
- # Context:
109
- You have found the following case extracts in either Swiss Federal Court or European Court of Human Rights cases that may provide context to the user's question:
110
- {context}"""
111
 
112
  print(system_message)
113
  messages = [{"role": "system", "content": system_message}]
 
96
  #print("# Case url: " + doc.metadata["case_url"] + spacer)
97
 
98
  system_message += f"""
99
+ A user is asking you the following question: {message}
100
+ Please answer the user in the same language that he used in his question using ONLY the following given context not any prior knowledge or information found on the internet.
101
+ # Context:
102
+ The following case extracts have been found in either Swiss Federal Court or European Court of Human Rights cases and could fit the question:
103
+ {context}
104
  # Task:
 
 
105
  If the retrieved context is not relevant cases or the issue has not been addressed within the context, just say "I can't find enough relevant information".
106
  Don't make up an answer or give irrelevant information not requested by the user.
107
  Otherwise, if relevant cases were found, answer in the user's question's language using the context that you found relevant and reference the sources, including the urls and dates.
108
  # Instructions:
109
+ Always answer the user using the language used in his question: {message}
110
+ """
 
 
111
 
112
  print(system_message)
113
  messages = [{"role": "system", "content": system_message}]