SonyaHas commited on
Commit
860da6d
·
verified ·
1 Parent(s): d3c5c7a

coded yes or no function

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