import random import gradio as gr def respond_yes_no_randomly(message, history): responses = ["Yes", "No"] return random.choice(responses) demo = gr.ChatInterface( respond_yes_no_randomly, title="Yes No Bot", description="This chatbot responds yes or no to your questions!", ) demo.launch()