Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.11 KB

visualize_views.md

File metadata and controls

36 lines (28 loc) · 1.11 KB

How-To: Visualize Views

To create simple UI interface use GradioAdapter class It allows to display Data Preview related to Views and execute user queries.

Installation

pip install dbally[gradio]

Create own gradio interface

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.

Links