Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,12 +16,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
16 |
)
|
17 |
|
18 |
chatbot = gr.Chatbot()
|
19 |
-
|
20 |
response = gr.Textbox
|
21 |
|
22 |
-
def respond(
|
23 |
-
response = get_chain(
|
24 |
-
chat_history.append((
|
25 |
return "", chat_history
|
26 |
|
27 |
|
@@ -35,10 +35,10 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
35 |
"I'm having problems at home",
|
36 |
"I am looking for some resources",
|
37 |
],
|
38 |
-
inputs=
|
39 |
)
|
40 |
|
41 |
-
send.click(respond, [
|
42 |
clear.click(lambda: None, None, chatbot, queue=False)
|
43 |
|
44 |
|
|
|
16 |
)
|
17 |
|
18 |
chatbot = gr.Chatbot()
|
19 |
+
chat_message = gr.Textbox(label="What would you like to chat about?")
|
20 |
response = gr.Textbox
|
21 |
|
22 |
+
def respond(chat_message, chat_history):
|
23 |
+
response = get_chain(chat_message, chat_history)
|
24 |
+
chat_history.append((chat_message, response))
|
25 |
return "", chat_history
|
26 |
|
27 |
|
|
|
35 |
"I'm having problems at home",
|
36 |
"I am looking for some resources",
|
37 |
],
|
38 |
+
inputs=chat_message
|
39 |
)
|
40 |
|
41 |
+
send.click(respond, [chat_message, chatbot], [chat_message, chatbot])
|
42 |
clear.click(lambda: None, None, chatbot, queue=False)
|
43 |
|
44 |
|