Chatbot1 / app.py
saherPervaiz's picture
Create app.py
422cae6 verified
raw
history blame
866 Bytes
import gradio as gr
from utils import generate_response
# Define chatbot interaction function
def chat(user_input):
response = generate_response(user_input)
return response
# Create Gradio interface
with gr.Blocks() as demo:
gr.Markdown("## 🤖 Professional Groq Chatbot")
gr.Markdown("Type your message below and chat with the AI!")
with gr.Row():
user_input = gr.Textbox(
label="Your Message",
placeholder="Ask me anything!",
lines=2,
)
submit_button = gr.Button("Send")
chatbot_output = gr.Textbox(
label="Response",
placeholder="AI's response will appear here.",
lines=6,
interactive=False,
)
submit_button.click(fn=chat, inputs=[user_input], outputs=[chatbot_output])
# Launch locally
if __name__ == "__main__":
demo.launch()