Update app.py
Browse files
app.py
CHANGED
|
@@ -105,11 +105,18 @@ with gr.Blocks(theme=theme) as chatbot:
|
|
| 105 |
|
| 106 |
with gr.Tab("Step 2"):
|
| 107 |
with gr.Column(scale=2):
|
| 108 |
-
gr.
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
)
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
chatbot.launch()
|
|
|
|
| 105 |
|
| 106 |
with gr.Tab("Step 2"):
|
| 107 |
with gr.Column(scale=2):
|
| 108 |
+
chatbot_display = gr.Chatbot(label="Gorf the Frog Druid 🐸")
|
| 109 |
+
message_box = gr.Textbox(placeholder="Ask Gorf anything...", label="Your Message")
|
| 110 |
+
send_button = gr.Button("Send")
|
| 111 |
+
history_state = gr.State([])
|
| 112 |
+
|
| 113 |
+
send_button.click(
|
| 114 |
+
respond,
|
| 115 |
+
inputs=[message_box, history_state, character_name, character_class, character_race, character_alignment],
|
| 116 |
+
outputs=[chatbot_display, history_state]
|
| 117 |
)
|
| 118 |
+
|
| 119 |
+
# Optional: clear textbox after sending
|
| 120 |
+
send_button.click(fn=lambda: "", inputs=None, outputs=message_box)
|
| 121 |
|
| 122 |
chatbot.launch()
|