holoviz / lumen

Illuminate your data.
https://lumen.holoviz.org
BSD 3-Clause "New" or "Revised" License
177 stars 20 forks source link

Data loading UI #772

Open amaloney opened 2 days ago

amaloney commented 2 days ago

Is your feature request related to a problem? Please describe.

The chat interface on the rhs of the page does not contain any information for the user until data has been correctly loaded. If I click any button in this section without loaded data, I get errors.

https://github.com/user-attachments/assets/09d72398-851a-48fd-8607-4d12d64f42e8

Describe the solution you'd like

I would propose this section be in a drawer if no data is loaded, and have the drawer visible once the user has gone through the correct pipeline for loading data.

Describe alternatives you've considered

Alternatives

  1. change the blue button color (a user is draw to this first)
  2. disable all buttons before data is loaded, or before data is loaded have all buttons output in the chat that a user needs to first upload data

Additional context

The environment used for this example is given below, as well as the app.py file and how to download the data shown in the video.

# environment.yaml
name: lumen-ai
channels:
    - conda-forge
dependencies:
    - python >3.9,<3.13
    - pip
    - pip:
        - panel ==1.5.4
        - panel-graphic-walker[kernel]

Clone, install the environment, activate it, install other dependencies, download data, etc.

git clone https://github.com/holoviz/lumen
cd lumen
conda env create --file environment.yaml && conda activate lumen-ai
pip install --editable .[ai-llama,sql]
wget --output-file=earthquakes.csv "https://earthquake.usgs.gov/fdsnws/event/1/query?format=csv"

Use panel to serve the below app code.

panel serve app.py --show
# app.py
import lumen.ai as lmai
llm = lmai.llm.Llama()
# NOTE: not-a-file.csv does not exist.
lmai.ExplorerUI(["not-a-file.csv"], llm=llm, agents=[lmai.agents.VegaLiteAgent]).servable()
philippjfr commented 2 days ago

I think the solution here is to error on launch if the data you're asking for doesn't exist.