Spaces:
Runtime error
Runtime error
Update app.py
Browse files12345678910111213141516import gradio as gr#import lines go at the top. Any libraries I needa import, go up here^^#we are coding a function that our chatbot will be able to run#if you say hello, the chatbot says hello backdef echo(message, history):return message#defining my chatbot so that the user can inteact and see their conversation...#history and send new messageschatbot = gr.ChatInterface(echo, type="messages")#we are launching our chatbotchatbot.launch()1234567891011121314151617181920212223242526272829import gradio as gr#using pythons random libraryimport random#import lines go at the top. Any libraries I needa import, go up here^^#we are coding a function that our chatbot will be able to run#if you say hello, the chatbot says hello back#we don't want the echo function to run, we want a different function so we...#comment echo out#def echo(message, history):#return message#use [] for a list#def yes_no(message, history):# return random.choice(['Yes', 'No'])def yes_or_no(message, history):responses = ["Yes", "No"]return random.choice(responses)#defining my chatbot so that the user can inteact and see their conversation...#history and send new messages#chatbot = gr.ChatInterface(yes_or_no, type="messages")chatbot = gr.ChatInterface(yes_or_no)#we are launching our chatbotchatbot.launch()
app.py+17-4