Spaces:
Runtime error
Runtime error
Commit
·
0366d06
1
Parent(s):
8b555d1
Update app.py
Browse files
app.py
CHANGED
@@ -66,14 +66,14 @@ chat_history = []
|
|
66 |
def answer_question(question):
|
67 |
global chat_history
|
68 |
result = chain({"question": question, "chat_history": chat_history})
|
69 |
-
fonti = "\n"
|
70 |
source_documents = result['source_documents']
|
71 |
for index, document in enumerate(source_documents):
|
72 |
fonti=fonti+f"Fonte {index + 1}:\n"
|
73 |
-
fonti=fonti+f"
|
74 |
-
fonti=fonti+f"
|
75 |
-
fonti=fonti+f"
|
76 |
-
fonti=fonti+f"
|
77 |
|
78 |
|
79 |
|
|
|
66 |
def answer_question(question):
|
67 |
global chat_history
|
68 |
result = chain({"question": question, "chat_history": chat_history})
|
69 |
+
fonti = "\n==================================\nFONTI"
|
70 |
source_documents = result['source_documents']
|
71 |
for index, document in enumerate(source_documents):
|
72 |
fonti=fonti+f"Fonte {index + 1}:\n"
|
73 |
+
fonti=fonti+f"Contesto: {document.page_content}\n"
|
74 |
+
fonti=fonti+f"Webinar: {document.metadata['title']}\n"
|
75 |
+
fonti=fonti+f"Secondi dall'inizio: {int(document.metadata['source'])}\n"
|
76 |
+
fonti=fonti+f"Link al filmato: https://www.youtube.com/watch?v={document.metadata['source_url']}&t={int(document.metadata['source'])}\n\n"
|
77 |
|
78 |
|
79 |
|