ewingreen commited on
Commit
cdab10d
·
verified ·
1 Parent(s): 2c1eb89

Added function yes_or_no

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