File size: 866 Bytes
422cae6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
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()