Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
6214252
1
Parent(s):
d20a350
test
Browse files
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 |
-
|
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"
|