Spaces:
Runtime error
Runtime error
| 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() | |