sarahrobe commited on
Commit
a921825
·
verified ·
1 Parent(s): 90b6338

added randomizer for responses

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