File size: 804 Bytes
b32d514
 
33951af
b32d514
33951af
b32d514
33951af
 
b32d514
33951af
 
 
 
 
 
b32d514
 
 
 
 
 
 
 
 
 
33951af
b32d514
33951af
 
b32d514
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
28
29
30
31
import gradio as gr  # pyre-ignore[21]
from databot import DataBot  # pyre-ignore[21]

print("Starting DataBot...")
bot = DataBot()
print("DataBot ready!\n")


def respond(message, history):
    """Handle a user message and return the bot's response."""
    if not message.strip():
        return ""
    return bot.ask(message)


demo = gr.ChatInterface(
    fn=respond,
    title="🤖 DataBot",
    description="Your intelligent ERP database assistant. Ask questions about your business data in English or French.",
    examples=[
        "How many products are there?",
        "Combien y a-t-il d'articles ?",
        "Show me the top 10 partners",
        "What are the recent sales?",
    ],
    theme=gr.themes.Soft(),
)

if __name__ == "__main__":
    demo.launch()