skip split on 'none of the sources'
Browse files- magic/conversational.py +1 -1
magic/conversational.py
CHANGED
@@ -36,7 +36,7 @@ async def question_handler(question: Question, state: State) -> Answer:
|
|
36 |
logger.info(f"Sources: {sources}")
|
37 |
if sources:
|
38 |
sources = re.findall(COURSE_PATTERN, sources)
|
39 |
-
|
40 |
answer, sources = split_sources(answer)
|
41 |
|
42 |
courses = [source.upper() for source in sources if state.course_exists(source)] # filter out courses that don't exist
|
|
|
36 |
logger.info(f"Sources: {sources}")
|
37 |
if sources:
|
38 |
sources = re.findall(COURSE_PATTERN, sources)
|
39 |
+
elif "none of the sources" not in answer.lower():
|
40 |
answer, sources = split_sources(answer)
|
41 |
|
42 |
courses = [source.upper() for source in sources if state.course_exists(source)] # filter out courses that don't exist
|