tanyadhast commited on
Commit
b9e324f
·
verified ·
1 Parent(s): b54faee

coded yes_or_no function

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,12 +1,16 @@
1
  import gradio as gr
 
2
  #import lines fo at the top! Any libraries I need to import go here
3
 
4
- def echo(message, history):
5
- return message
 
 
 
6
  #a function that the user's message is repeated back to you
7
 
8
  print("Hello World")
9
- chatbot = gr.ChatInterface(echo, type="messages")
10
  #defining my chatbot so that the user can interact and see their conversation history and send me messages
11
 
12
  chatbot.launch()
 
1
  import gradio as gr
2
+ import random
3
  #import lines fo at the top! Any libraries I need to import go here
4
 
5
+ def yes_or_no(message, history):
6
+ return random.choice(['Yes', "No"])
7
+
8
+ #def echo(message, history):
9
+ #return message
10
  #a function that the user's message is repeated back to you
11
 
12
  print("Hello World")
13
+ chatbot = gr.ChatInterface(yes_or_no, type="messages")
14
  #defining my chatbot so that the user can interact and see their conversation history and send me messages
15
 
16
  chatbot.launch()