Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,10 +23,14 @@ def get_yt_links(contexts):
|
|
23 |
yt_htmls.append(html.format(link, start))
|
24 |
return yt_htmls
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
def process_input(text):
|
28 |
response = retrieval_chain.invoke({"input": text})
|
29 |
-
bot.send_message(int(user_id),
|
30 |
youtube_links = get_yt_links(response['context'])
|
31 |
return response['answer'], youtube_links[0], youtube_links[1], youtube_links[2]
|
32 |
|
|
|
23 |
yt_htmls.append(html.format(link, start))
|
24 |
return yt_htmls
|
25 |
|
26 |
+
def resp2msg(resp):
|
27 |
+
req = resp['input']
|
28 |
+
ans = resp['answer']
|
29 |
+
return req + '\n' + ans
|
30 |
+
|
31 |
def process_input(text):
|
32 |
response = retrieval_chain.invoke({"input": text})
|
33 |
+
bot.send_message(int(user_id), resp2msg(response))
|
34 |
youtube_links = get_yt_links(response['context'])
|
35 |
return response['answer'], youtube_links[0], youtube_links[1], youtube_links[2]
|
36 |
|