Chatbot / app.py
deshnaashok's picture
Add all necessary files for Hugging Face Spaces Gradio chatbot deployment
c0a093e
raw
history blame contribute delete
579 Bytes
import gradio as gr
from enhanced_rag_chatbot import get_chatbot
chatbot = get_chatbot()
# Simple chat function for Gradio
def chat_fn(message, mode="extract"):
try:
response = chatbot.chat(message, mode=mode)
return response
except Exception as e:
return f"❌ Error: {str(e)}"
iface = gr.ChatInterface(
fn=lambda message, history: chat_fn(message),
title="Rackspace Knowledge Assistant",
description="Ask questions about Rackspace documentation. Uses Groq API and enhanced RAG retrieval.",
theme="default",
)
iface.launch()