Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -147,7 +147,7 @@ def answer_lecturer_query(query):
|
|
| 147 |
else:
|
| 148 |
return answer_general_query(query)
|
| 149 |
|
| 150 |
-
def get_links_response(query):
|
| 151 |
school_files = ["past questions", "pst questions", "pq", "pstq", "slides for"]
|
| 152 |
study_smarter = ["flashcards", "study set", "study", "study app", "study link", "slides", "today", "class", "lecturer"]
|
| 153 |
|
|
@@ -183,11 +183,11 @@ def answer_doc_link_query(query):
|
|
| 183 |
# Retrieve the prefix from the previous word
|
| 184 |
query_course_code = f"{query.split()[i - 1]} {word}"
|
| 185 |
if query_course_code.upper() == best_match['course_code']:
|
| 186 |
-
return get_links_response(query)
|
| 187 |
else:
|
| 188 |
return "Sorry, I couldn't find info about the course you've mentioned."
|
| 189 |
else:
|
| 190 |
-
return
|
| 191 |
|
| 192 |
else:
|
| 193 |
return "Sure! To assist you better, please provide the name or code of the course you are referring to, along with the entire query."
|
|
|
|
| 147 |
else:
|
| 148 |
return answer_general_query(query)
|
| 149 |
|
| 150 |
+
def get_links_response(query, best_match):
|
| 151 |
school_files = ["past questions", "pst questions", "pq", "pstq", "slides for"]
|
| 152 |
study_smarter = ["flashcards", "study set", "study", "study app", "study link", "slides", "today", "class", "lecturer"]
|
| 153 |
|
|
|
|
| 183 |
# Retrieve the prefix from the previous word
|
| 184 |
query_course_code = f"{query.split()[i - 1]} {word}"
|
| 185 |
if query_course_code.upper() == best_match['course_code']:
|
| 186 |
+
return get_links_response(query, best_match))
|
| 187 |
else:
|
| 188 |
return "Sorry, I couldn't find info about the course you've mentioned."
|
| 189 |
else:
|
| 190 |
+
return get_links_response(query, best_match)
|
| 191 |
|
| 192 |
else:
|
| 193 |
return "Sure! To assist you better, please provide the name or code of the course you are referring to, along with the entire query."
|