Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ def respond(
|
|
| 37 |
top_p,
|
| 38 |
score,
|
| 39 |
):
|
| 40 |
-
messages = [{"role": "system", "content": system_message}]
|
| 41 |
|
| 42 |
print(datetime.now())
|
| 43 |
print(system_message)
|
|
@@ -92,7 +92,7 @@ def respond(
|
|
| 92 |
#print("# Case number: " + doc.metadata["case_nb"] + spacer)
|
| 93 |
#print("# Case url: " + doc.metadata["case_url"] + spacer)
|
| 94 |
|
| 95 |
-
|
| 96 |
A user is asking you the following question: {message}
|
| 97 |
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.
|
| 98 |
# Context:
|
|
@@ -106,7 +106,8 @@ Otherwise, if relevant cases were found, answer in the user's question's languag
|
|
| 106 |
Always answer the user using the language used in his question: {message}
|
| 107 |
"""
|
| 108 |
|
| 109 |
-
print(
|
|
|
|
| 110 |
|
| 111 |
# for val in history:
|
| 112 |
# if val[0]:
|
|
|
|
| 37 |
top_p,
|
| 38 |
score,
|
| 39 |
):
|
| 40 |
+
#messages = [{"role": "system", "content": system_message}]
|
| 41 |
|
| 42 |
print(datetime.now())
|
| 43 |
print(system_message)
|
|
|
|
| 92 |
#print("# Case number: " + doc.metadata["case_nb"] + spacer)
|
| 93 |
#print("# Case url: " + doc.metadata["case_url"] + spacer)
|
| 94 |
|
| 95 |
+
system_message = f"""
|
| 96 |
A user is asking you the following question: {message}
|
| 97 |
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.
|
| 98 |
# Context:
|
|
|
|
| 106 |
Always answer the user using the language used in his question: {message}
|
| 107 |
"""
|
| 108 |
|
| 109 |
+
print(system_message)
|
| 110 |
+
messages = [{"role": "system", "content": system_message}]
|
| 111 |
|
| 112 |
# for val in history:
|
| 113 |
# if val[0]:
|