tatts commited on
Commit
3c4f785
1 Parent(s): dde7a82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- document_links_text = "\n".join(document_links)
275
- links_text = f"\n\nSources:\n{document_links_text}"
276
- return ai_message['answer'] + "\n" + links_text
 
 
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