RedTachyon commited on
Commit
66df48d
1 Parent(s): 3e58c0c

Better message in lookup failure

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -72,8 +72,10 @@ if __name__ == "__main__":
72
  )
73
 
74
  context = f"Looking at the video titled {best_chunk.title}"
 
 
75
 
76
- return completion.choices[0].message.content, context
77
 
78
  def get_answer_better(api_key: str, query: str) -> str:
79
  client = OpenAI(api_key=api_key)
 
72
  )
73
 
74
  context = f"Looking at the video titled {best_chunk.title}"
75
+ answer = completion.choices[0].message.content
76
+ answer = answer if "<|UNKNOWN|>" not in answer else "Couldn't find the answer."
77
 
78
+ return answer, context
79
 
80
  def get_answer_better(api_key: str, query: str) -> str:
81
  client = OpenAI(api_key=api_key)