Heramb1 commited on
Commit
388c48c
1 Parent(s): 469ebd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -17
app.py CHANGED
@@ -1,19 +1,10 @@
1
- import gradio as gr
2
 
3
- def chatbot(message):
4
- # Replace with your chatbot logic
5
- response = f"Hi! You said: {message}"
6
- return response
7
- interface = gr.Blocks([
8
- gr.Textbox(label="Your message:"),
9
- gr.Chatbot(),
10
- ])
11
 
12
- # Update chatbot history on submit
13
- def submit(inputs, outputs):
14
- message = inputs.Textbox.value
15
- outputs.Chatbot.append((message, None))
16
- outputs.Chatbot.append((None, chatbot(message)))
17
- outputs.Textbox.value = "" # Clear input field
18
-
19
- interface.launch(fn=submit)
 
1
+ from gradio import Interface
2
 
3
+ def chat(message):
4
+ # Implement basic conversation logic here
5
+ # For example, provide predefined responses based on keywords
6
+ response = "Hi there! How can I help you today?"
7
+ return response
 
 
 
8
 
9
+ interface = Interface(fn=chat, inputs="textbox", outputs="text")
10
+ interface.launch()