Spaces:
Sleeping
Sleeping
| 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() | |