macadeliccc commited on
Commit
6214252
·
1 Parent(s): d20a350
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -28,10 +28,12 @@ start_ochat_server()
28
  def user(message, history):
29
  return "", history + [[message, None]]
30
 
31
-
32
  def bot(history):
33
- return chat_with_ochat(history[-1][0]), history + [[None, chat_with_ochat(history[-1][0])]]
34
-
 
 
 
35
  # Function to send a message to the ochat server and get a response
36
  def chat_with_ochat(message):
37
  url = "http://0.0.0.0:18888/v1/chat/completions"
 
28
  def user(message, history):
29
  return "", history + [[message, None]]
30
 
 
31
  def bot(history):
32
+ if history and history[-1] and history[-1][0]:
33
+ user_message = history[-1][0]
34
+ bot_response = chat_with_ochat(user_message)
35
+ return "", history + [(None, bot_response)]
36
+ return "", history
37
  # Function to send a message to the ochat server and get a response
38
  def chat_with_ochat(message):
39
  url = "http://0.0.0.0:18888/v1/chat/completions"