Iva-M commited on
Commit
b0ee8dd
·
verified ·
1 Parent(s): c231631

Create random yes or no response function

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