Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
def echo(message, history):
|
| 4 |
-
return message
|
| 5 |
|
| 6 |
-
print("hello, world!")
|
| 7 |
|
| 8 |
-
chatbot = gr.ChatInterface(
|
| 9 |
|
| 10 |
chatbot.launch()
|
| 11 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random #added here
|
| 3 |
+
|
| 4 |
+
def respond_yes_or_no_randomaly(message, history): #added here
|
| 5 |
+
responses = ["yes", "no"]
|
| 6 |
+
return random.choice(responses) #added here
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
|
|
|
| 9 |
|
| 10 |
+
chatbot = gr.ChatInterface(respond_yes_or_no_randomaly, type="messages", title="yes no bot") #chatbot UI - conversation history and user input
|
| 11 |
|
| 12 |
chatbot.launch()
|
| 13 |
|