Spaces:
Sleeping
Sleeping
Update app.py
Browse filesRework Chatbot
app.py
CHANGED
@@ -72,22 +72,18 @@ with gr.Blocks() as demo:
|
|
72 |
|
73 |
def respond(message, chat_history):
|
74 |
messages = [ChatMessage(role="user", content=message)]
|
75 |
-
|
76 |
-
# model=MODEL,
|
77 |
-
# messages=messages)
|
78 |
-
|
79 |
response = forecast(messages)
|
80 |
|
81 |
-
|
82 |
-
#
|
83 |
-
#
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
)
|
88 |
-
|
89 |
-
|
90 |
-
]
|
91 |
|
92 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
93 |
|
|
|
72 |
|
73 |
def respond(message, chat_history):
|
74 |
messages = [ChatMessage(role="user", content=message)]
|
75 |
+
|
|
|
|
|
|
|
76 |
response = forecast(messages)
|
77 |
|
78 |
+
chat_history.append((message, str(response)))
|
79 |
+
# final_response = CLIENT.chat(
|
80 |
+
# model=MODEL,
|
81 |
+
# messages=prompt
|
82 |
+
# ).choices[0].message.content
|
83 |
+
# return [[message, None],
|
84 |
+
# [None, str(response)]
|
85 |
+
# ]
|
86 |
+
return "", chat_history
|
|
|
87 |
|
88 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
89 |
|