erseux commited on
Commit
4e1de02
1 Parent(s): 6c7f4e8

skip split on 'none of the sources'

Browse files
Files changed (1) hide show
  1. 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
- else:
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