To create simple UI interface use GradioAdapter class It allows to display Data Preview related to Views and execute user queries.
pip install dbally[gradio]
Define collection with implemented views
llm = LiteLLM(model_name="gpt-3.5-turbo")
collection = dbally.create_collection("recruitment", llm, event_handlers=[CLIEventHandler()])
collection.add(CandidateView, lambda: CandidateView(engine))
collection.add(SampleText2SQLView, lambda: SampleText2SQLView(prepare_freeform_enginge()))
Create gradio interface
gradio_adapter = GradioAdapter()
gradio_interface = await gradio_adapter.create_interface(collection)
Launch the gradio interface. To publish public interface pass argument share=True
gradio_interface.launch()
The endpoint is set by by triggering python module with Gradio Adapter launch command. Private endpoint is set to http://127.0.0.1:7860/ by default.