Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -801,13 +801,16 @@ def submit_message(prompt, prompt_template, temperature, max_tokens, context_len
|
|
801 |
|
802 |
completion = { "content": completion }
|
803 |
print("completion text")
|
|
|
804 |
for document in completion['content']['source_documents']:
|
805 |
-
#
|
806 |
-
|
|
|
807 |
print("Metadata:", metadata)
|
808 |
|
809 |
|
810 |
|
|
|
811 |
|
812 |
#chat_messages = [(prompt_msg['content'], completion['content'])]
|
813 |
chat_messages = [(prompt, completion['content']['answer'])]
|
|
|
801 |
|
802 |
completion = { "content": completion }
|
803 |
print("completion text")
|
804 |
+
|
805 |
for document in completion['content']['source_documents']:
|
806 |
+
# This assumes 'metadata' is an attribute of the objects in 'source_documents'
|
807 |
+
# This line will vary based on the actual implementation of these objects
|
808 |
+
metadata = document.metadata # Use dot notation to access an attribute
|
809 |
print("Metadata:", metadata)
|
810 |
|
811 |
|
812 |
|
813 |
+
|
814 |
|
815 |
#chat_messages = [(prompt_msg['content'], completion['content'])]
|
816 |
chat_messages = [(prompt, completion['content']['answer'])]
|