alexkueck commited on
Commit
c4456e4
1 Parent(s): c947a10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -272,10 +272,15 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, anzahl_doc
272
 
273
  #Ergebnisse für history und chatbot zusammenstellen
274
  summary = "Zusammenfassung: \n" + str(results['answer']) + "\n Aus den Dokumenten: \n"
275
- summary += " ".join(['Dokument: ' + str(doc['path']) + 'Seite: ' + str(doc['page']) + '\nAuschnitt: ' + str(doc["content"]) for doc in results['relevant_docs']])
276
- print("summary:....................." + summary)
 
 
 
 
 
277
  history = history + [[prompt_in, summary]]
278
- print("history.........................."+str(history))
279
  chatbot[-1][1] = summary
280
  return chatbot, history, None, file_history, ""
281
 
 
272
 
273
  #Ergebnisse für history und chatbot zusammenstellen
274
  summary = "Zusammenfassung: \n" + str(results['answer']) + "\n Aus den Dokumenten: \n"
275
+ #summary += " ".join(['Dokument: ' + str(doc['titel']) + ' Seite: ' + str(doc['seite']) + '\nAuschnitt: ' + str(doc["content"]) for doc in results['relevant_docs']])
276
+ summary = " ".join([
277
+ '<b>Dokument:</b> <span style="color: pink;">' + str(doc['titel']) + '</span> '
278
+ '<span style="color: red;">Seite:</span> ' + str(doc['seite']) + '<br>'
279
+ '<b>Auschnitt:</b> ' + str(doc["content"])
280
+ for doc in results['relevant_docs']
281
+ ])
282
  history = history + [[prompt_in, summary]]
283
+
284
  chatbot[-1][1] = summary
285
  return chatbot, history, None, file_history, ""
286