Nelly-43 commited on
Commit
3068ee8
·
1 Parent(s): 1c80fab

update ticket saving

Browse files
Files changed (1) hide show
  1. app_web.py +4 -5
app_web.py CHANGED
@@ -265,11 +265,6 @@ def process_contact_request(original_query:str, qcat_result:Dict, uploaded_files
265
  "status":"open",
266
  "chat_history":st.session_state.messages,
267
  }
268
-
269
-
270
- #save ticket
271
- with open(f"{DATA_DIR}/tickets/{ticket}/contact_data.json", "w", encoding="utf-8") as f:
272
- json.dump(contact_data, f, indent=4)
273
 
274
  if qcat_result.get("action") == "contact":
275
 
@@ -292,6 +287,10 @@ def process_contact_request(original_query:str, qcat_result:Dict, uploaded_files
292
  please contact the WEAI Helpdesk at IFPRI-WEAI@cgiar.org.\n\n
293
  Please let me know if there's anything else I can assist you with today.""".format(ticket_id=ticket))
294
 
 
 
 
 
295
  if qcat_result.get("action") == "upload":
296
  if uploaded_files:
297
  # Specify the path where the zip file will be saved
 
265
  "status":"open",
266
  "chat_history":st.session_state.messages,
267
  }
 
 
 
 
 
268
 
269
  if qcat_result.get("action") == "contact":
270
 
 
287
  please contact the WEAI Helpdesk at IFPRI-WEAI@cgiar.org.\n\n
288
  Please let me know if there's anything else I can assist you with today.""".format(ticket_id=ticket))
289
 
290
+ #save ticket
291
+ with open(f"{DATA_DIR}/tickets/{ticket}/contact_data.json", "w", encoding="utf-8") as f:
292
+ json.dump(contact_data, f, indent=4)
293
+
294
  if qcat_result.get("action") == "upload":
295
  if uploaded_files:
296
  # Specify the path where the zip file will be saved