File size: 579 Bytes
c0a093e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()