Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -260,14 +260,14 @@ def log_history(email: str,chat_history: list) -> None:
|
|
| 260 |
# Save the log to the file
|
| 261 |
with history_scheduler.lock:
|
| 262 |
# Open the log file in append mode
|
| 263 |
-
with
|
| 264 |
f.write(json.dumps({
|
| 265 |
"email": email,
|
| 266 |
"chat_history": chat_history,
|
| 267 |
"timestamp": str(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
| 268 |
}))
|
| 269 |
|
| 270 |
-
st.write("chat_recorded")
|
| 271 |
|
| 272 |
|
| 273 |
def log_action(customer_id: str,task: str, details: str) -> None:
|
|
@@ -499,7 +499,7 @@ def chatbot_interface():
|
|
| 499 |
|
| 500 |
|
| 501 |
details = fetch_details(st.session_state.email)
|
| 502 |
-
st.write(details)
|
| 503 |
prompt = build_prompt(details)
|
| 504 |
tools = [sql_tool,defer_to_human, rag, register_feedback, days_since]
|
| 505 |
|
|
|
|
| 260 |
# Save the log to the file
|
| 261 |
with history_scheduler.lock:
|
| 262 |
# Open the log file in append mode
|
| 263 |
+
with history_file.open("a") as f:
|
| 264 |
f.write(json.dumps({
|
| 265 |
"email": email,
|
| 266 |
"chat_history": chat_history,
|
| 267 |
"timestamp": str(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
| 268 |
}))
|
| 269 |
|
| 270 |
+
#st.write("chat_recorded")
|
| 271 |
|
| 272 |
|
| 273 |
def log_action(customer_id: str,task: str, details: str) -> None:
|
|
|
|
| 499 |
|
| 500 |
|
| 501 |
details = fetch_details(st.session_state.email)
|
| 502 |
+
# st.write(details)
|
| 503 |
prompt = build_prompt(details)
|
| 504 |
tools = [sql_tool,defer_to_human, rag, register_feedback, days_since]
|
| 505 |
|