Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,8 +110,15 @@ def respond(message, history):
|
|
| 110 |
{"role": "user", "content": message},
|
| 111 |
{"role": "assistant", "content": full_answer}
|
| 112 |
]
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
| 114 |
# Clear input
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
return "", new_history # Return cleared msg, updated history
|
| 116 |
#====================
|
| 117 |
def extract_docx_text(file_path):
|
|
|
|
| 110 |
{"role": "user", "content": message},
|
| 111 |
{"role": "assistant", "content": full_answer}
|
| 112 |
]
|
| 113 |
+
history_string = "\n".join([
|
| 114 |
+
f"{item['role']}: {item['content']}"
|
| 115 |
+
for item in new_history
|
| 116 |
+
])
|
| 117 |
# Clear input
|
| 118 |
+
try:
|
| 119 |
+
update_log("\nFrom Chat: "+datetime.now().isoformat()+"\n"+history_string+"\n")
|
| 120 |
+
except Exception as ee:
|
| 121 |
+
print(f"Error: {ee} - not saved the log")
|
| 122 |
return "", new_history # Return cleared msg, updated history
|
| 123 |
#====================
|
| 124 |
def extract_docx_text(file_path):
|