Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ openai = OpenAI(
|
|
42 |
)
|
43 |
SESSION_ID = "default"
|
44 |
|
45 |
-
pending_clarifications = {}
|
46 |
|
47 |
def call_llm(model: str, messages: list[dict], temperature: float = 0.0, **kwargs) -> str:
|
48 |
resp = openai.chat.completions.create(
|
@@ -98,19 +98,19 @@ def process_query(query: str, first_turn: bool = False, session_id: str = "defau
|
|
98 |
)
|
99 |
process_log.append(f"Relevance Check: {relevance}")
|
100 |
|
101 |
-
redirect_message = "Hello I’m Wisal, an AI assistant developed by Compumacy AI, and a knowledgeable Autism specialist.\nIf you have any question related to autism please submit a question specifically about autism."
|
102 |
|
103 |
-
if relevance.startswith("Hello I’m Wisal"):
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
|
110 |
-
if relevance != "RELATED":
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
|
115 |
return process_autism_pipeline(corrected_query, process_log, intro)
|
116 |
|
|
|
42 |
)
|
43 |
SESSION_ID = "default"
|
44 |
|
45 |
+
# pending_clarifications = {}
|
46 |
|
47 |
def call_llm(model: str, messages: list[dict], temperature: float = 0.0, **kwargs) -> str:
|
48 |
resp = openai.chat.completions.create(
|
|
|
98 |
)
|
99 |
process_log.append(f"Relevance Check: {relevance}")
|
100 |
|
101 |
+
# redirect_message = "Hello I’m Wisal, an AI assistant developed by Compumacy AI, and a knowledgeable Autism specialist.\nIf you have any question related to autism please submit a question specifically about autism."
|
102 |
|
103 |
+
# if relevance.startswith("Hello I’m Wisal"):
|
104 |
+
# clarification = f"Your query was not clearly related to autism. Do you mean:\n\"{corrected_query}\"\nIf yes, please confirm so I can help. If not:\n{redirect_message}"
|
105 |
+
# pending_clarifications[session_id] = corrected_query
|
106 |
+
# process_log.append(f"Clarification Prompted: {clarification}")
|
107 |
+
# _save_process_log(process_log)
|
108 |
+
# return clarification
|
109 |
|
110 |
+
# if relevance != "RELATED":
|
111 |
+
# process_log.append("Query not autism-related.")
|
112 |
+
# _save_process_log(process_log)
|
113 |
+
# return intro + relevance
|
114 |
|
115 |
return process_autism_pipeline(corrected_query, process_log, intro)
|
116 |
|