Update app.py
Browse files
app.py
CHANGED
@@ -271,9 +271,11 @@ def ask(question, history):
|
|
271 |
if 'url' in doc.metadata:
|
272 |
document_links.append(doc.metadata['url'])
|
273 |
# Format document links as part of the text output
|
274 |
-
|
275 |
-
|
276 |
-
|
|
|
|
|
277 |
|
278 |
demo = gr.ChatInterface(fn=ask, title="UNTE ChatBot",theme=gr.themes.Soft())
|
279 |
|
|
|
271 |
if 'url' in doc.metadata:
|
272 |
document_links.append(doc.metadata['url'])
|
273 |
# Format document links as part of the text output
|
274 |
+
if document_links:
|
275 |
+
document_links_text = "\n".join(document_links)
|
276 |
+
links_text = f"\n\nSources:\n{document_links_text}"
|
277 |
+
else:
|
278 |
+
links_text = "UNTE_ASSISTANTE"
|
279 |
|
280 |
demo = gr.ChatInterface(fn=ask, title="UNTE ChatBot",theme=gr.themes.Soft())
|
281 |
|