Spaces:
Sleeping
Sleeping
File size: 804 Bytes
d495c31 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import gradio as gr
def chatbot_response(user_input, history=[]):
# Simulate a bot response
bot_reply = "This is a simulated response."
# Update history
history.append({"user": user_input, "bot": bot_reply})
return bot_reply, history
# Gradio UI Setup
def gradio_interface():
with gr.Blocks() as chatbot_ui:
gr.Markdown("## Fake Chatbot UI")
user_input = gr.Textbox(label="User Input", placeholder="Type your message here...", lines=2)
chat_history = gr.Chatbot()
def respond(user_input, history):
bot_reply, history = chatbot_response(user_input, history)
return history, history
user_input.submit(respond, [user_input, chat_history], [chat_history, chat_history])
chatbot_ui.launch()
gradio_interface() |