File size: 571 Bytes
526f10b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr

# Function to get the response from your query engine
def get_response(prompt):
    response = query_engine.query(prompt)  # Call your query engine here
    return response

# Gradio interface
def chatbot(prompt):
    response = get_response(prompt)
    return "", response

# Create the Gradio app
iface = gr.Interface(
    fn=chatbot,
    inputs=gr.Textbox(lines=7, label="You"),
    outputs=[
        gr.Textbox(label="Bot"),
        gr.Textbox(),
    ],
    title="Chatbot",
    description="Ask me anything!",
)

# Launch the app
iface.launch()