Spaces:
Sleeping
Sleeping
File size: 842 Bytes
aae6802 c3ef2e5 aae6802 3d03402 c3ef2e5 3d03402 c3ef2e5 aae6802 c3ef2e5 aae6802 c3ef2e5 aae6802 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import gradio as gr
#using pythons random library
import random
#import lines go at the top. Any libraries I needa import, go up here^^
#we are coding a function that our chatbot will be able to run
#if you say hello, the chatbot says hello back
#we don't want the echo function to run, we want a different function so we...
#comment echo out
#def echo(message, history):
#return message
#use [] for a list
#def yes_no(message, history):
# return random.choice(['Yes', 'No'])
def yes_or_no(message, history):
responses = ["Yes", "No"]
return random.choice(responses)
#defining my chatbot so that the user can inteact and see their conversation...
#history and send new messages
#chatbot = gr.ChatInterface(yes_or_no, type="messages")
chatbot = gr.ChatInterface(yes_or_no)
#we are launching our chatbot
chatbot.launch()
|