ryanrwatkins commited on
Commit
4793a8f
1 Parent(s): 22b417b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- # Access the metadata for each document
806
- metadata = document['metadata']
 
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'])]