import gradio as gr import random import time def respond(message, chat_history): time.sleep(2) # simulate delay bot_message_text=random.choice(["How are you?", "Today is a great day", "I'm very hungry"]) return bot_message_text if __name__ == "__main__": demo = gr.ChatInterface( fn=respond, chatbot = gr.Chatbot(height=400, placeholder="Start chatting..."), textbox=gr.Textbox(placeholder="Type a message..."), title="Simple Gradio 6.x Chatbot", description="A random response chatbot." ) demo.launch(debug=True)