Subha95's picture
Update app.py
edf6046 verified
raw
history blame
635 Bytes
import gradio as gr
from chatbot_rag import get_answer # import your function
def respond(message, history):
"""
Respond function for Gradio ChatInterface.
message: latest user query
history: full chat history (list of [user, bot] pairs)
"""
# Call your RAG pipeline
response = get_answer(message)
return response
# Simple Gradio Chat Interface
chatbot = gr.ChatInterface(
fn=respond,
type="messages", # since your RAG returns plain text
title="Harry Potter Wikipedia",
description="Ask me anything from my knowledge base."
)
if __name__ == "__main__":
chatbot.launch()