peterpull commited on
Commit
f180b59
·
1 Parent(s): 4f6aab4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,17 +31,17 @@ def generate_text() -> str:
31
  with open(DATA_FILE) as file:
32
  text = ""
33
  for line in file:
34
- row_parts = line.strip().split(",")
35
  if len(row_parts) != 3:
36
  continue
37
  user, chatbot, time = row_parts
38
- text += f"User: {user}\nChatbot: {chatbot}\nTime: {time}\n\n"
39
  return text if text else "No messages yet"
40
 
41
  def store_message(chatinput: str, chatresponse: str):
42
  if chatinput and chatresponse:
43
  with open(DATA_FILE, "a") as file:
44
- file.write(f"{chatinput},{chatresponse},{datetime.now()}\n")
45
 
46
  return generate_text()
47
 
 
31
  with open(DATA_FILE) as file:
32
  text = ""
33
  for line in file:
34
+ row_parts = line.strip().split(";")
35
  if len(row_parts) != 3:
36
  continue
37
  user, chatbot, time = row_parts
38
+ text += f"Time: {time}\nUser: {user}\nChatbot: {chatbot}\n\n"
39
  return text if text else "No messages yet"
40
 
41
  def store_message(chatinput: str, chatresponse: str):
42
  if chatinput and chatresponse:
43
  with open(DATA_FILE, "a") as file:
44
+ file.write(f"{datetime.now()},{chatinput},{chatresponse}\n")
45
 
46
  return generate_text()
47