anniesaxena commited on
Commit
938da7e
·
verified ·
1 Parent(s): 3e4b803

Respond Yes No Randomly Function

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