File size: 995 Bytes
76fc11a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
import gradio as gr
from agent import chat_with_turbot

def respond(message, history):
    """
    Main chat function for TurBot.
    """
    try:
        response = chat_with_turbot(message, history)
        return response
    except Exception as e:
        return f"Izvinjavam se, došlo je do greške: {str(e)}"

# Create a simple interface
demo = gr.Interface(
    fn=respond,
    inputs=[
        gr.Textbox(label="Vaše pitanje", placeholder="Pitajte me o putovanjima..."),
        gr.State([])
    ],
    outputs=gr.Textbox(label="TurBot odgovor"),
    title="TurBot - Digitalni Asistent za Turističku Agenciju",
    description="Dobrodošli! Ja sam TurBot, vaš digitalni asistent za putovanja.",
    examples=[
        ["Koje letnje ponude imate za Mediteran?"],
        ["Tražim putovanje u Grčku u junu ili julu za porodicu od četiri osobe, budžet do 2000€."],
        ["Koji all-inclusive paketi za Tursku su dostupni?"]
    ]
)

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