sofiafraga commited on
Commit
04aaf05
·
verified ·
1 Parent(s): 9c8514d

create random yes or no response functions

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,7 +1,11 @@
1
  import gradio as gr
 
2
 
3
- def echo(message, history):
4
- return message
 
 
 
5
 
6
- chatbot = gr.ChatInterface(echo)
7
  chatbot.launch()
 
1
  import gradio as gr
2
+ import random
3
 
4
+ #Importing gradio for chatbox and random for responses
5
+
6
+ def respond_yes_or_no(message, history):
7
+ responses = ["Yes", "No"]
8
+ return random.choice(responses)
9
 
10
+ chatbot = gr.ChatInterface(respond_yes_or_no, type "messages")
11
  chatbot.launch()