Spaces:
Sleeping
Sleeping
RedTachyon
commited on
Commit
•
66df48d
1
Parent(s):
3e58c0c
Better message in lookup failure
Browse files
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
|
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)
|