Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,8 +20,8 @@ preamble = (" The person asking the following prompt is a person living with HIV
|
|
| 20 |
" For every response, recognize that they already have HIV and do not suggest that they have to get tested"
|
| 21 |
" for HIV or take post-exposure prophylaxis, as that is not relevant, though their partners perhaps should."
|
| 22 |
" Do not suggest anything that is not relevant to someone who already has HIV."
|
| 23 |
-
" They are asking questions through a mobile application called Nishauri"
|
| 24 |
-
" through which they can see their lab results, appointment histories, and upcoming appointments."
|
| 25 |
" Here is some information that is authoritative and should guide responses, when relevant."
|
| 26 |
" For questions about viral load, be sure to provide specific information"
|
| 27 |
" about cutoffs for viral load categories. Under 50 copies/ml is low detectable level,"
|
|
@@ -40,7 +40,8 @@ preamble = (" The person asking the following prompt is a person living with HIV
|
|
| 40 |
" then viral load sample should be taken after three months."
|
| 41 |
" Please answer the prompt using the information retrieved"
|
| 42 |
" and do not rely at all on your prior knowledge."
|
| 43 |
-
" Please keep your reply to no longer than three sentences, and please use simple language. ")
|
|
|
|
| 44 |
|
| 45 |
prompt_intro = (" Here is the prompt: ")
|
| 46 |
|
|
@@ -50,7 +51,7 @@ def nishauri(question: str, conversation_history: list[str]):
|
|
| 50 |
|
| 51 |
|
| 52 |
context = " ".join([item["user"] + " " + item["chatbot"] for item in conversation_history])
|
| 53 |
-
response = query_engine.query(
|
| 54 |
"the user previously asked and received the following: " +
|
| 55 |
context +
|
| 56 |
prompt_intro +
|
|
|
|
| 20 |
" For every response, recognize that they already have HIV and do not suggest that they have to get tested"
|
| 21 |
" for HIV or take post-exposure prophylaxis, as that is not relevant, though their partners perhaps should."
|
| 22 |
" Do not suggest anything that is not relevant to someone who already has HIV."
|
| 23 |
+
# " They are asking questions through a mobile application called Nishauri"
|
| 24 |
+
# " through which they can see their lab results, appointment histories, and upcoming appointments."
|
| 25 |
" Here is some information that is authoritative and should guide responses, when relevant."
|
| 26 |
" For questions about viral load, be sure to provide specific information"
|
| 27 |
" about cutoffs for viral load categories. Under 50 copies/ml is low detectable level,"
|
|
|
|
| 40 |
" then viral load sample should be taken after three months."
|
| 41 |
" Please answer the prompt using the information retrieved"
|
| 42 |
" and do not rely at all on your prior knowledge."
|
| 43 |
+
# " Please keep your reply to no longer than three sentences, and please use simple language. ")
|
| 44 |
+
)
|
| 45 |
|
| 46 |
prompt_intro = (" Here is the prompt: ")
|
| 47 |
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
context = " ".join([item["user"] + " " + item["chatbot"] for item in conversation_history])
|
| 54 |
+
response = query_engine.query(preamble +
|
| 55 |
"the user previously asked and received the following: " +
|
| 56 |
context +
|
| 57 |
prompt_intro +
|