#110 — LlmEngine provide all data for ChatResponseEcharts

Repo: Twill-AI/twill-llm-engine State: closed | Status: done Assignee: meliascosta

Created: 2024-08-29 · Updated: 2024-09-05

Description

By-design LLM Engine should provide the following data for each generated plot:

Image

I.e.:

  • name - human-friendly name for widget.
  • sql_query - SQL query to update widget “rows” with values matching “headers” order and type.
  • echarts_code - code to render Apache Echarts.
  • headers - list of headers for data.
  • rows - rows of data obtained during generating plot/widget in LLM Chat.
  • values_update_interval_sec - number of seconds after which data on widget would be outdated. For example if user asked data with a sampling rate of “per month” then update interval may be 60*60*24*15 - i.e. each 15 days. If sample rate is each hour then 60*30. If user asked data in specific “stable/won’t change” interval (like in a month in previous year) then need to provide -1 value (aka “don’t update”). If plot doesn’t include time directly or asked interval is very close to current date and may change (like “in last week/month”) then need to extract some insights from existing data like “mean interval rows were updated in relevant tables” and provide half of this interval.

Currently name and values_update_interval_sec are not provided. Also need to check that order and type of columns returned by sql_query matches headers.

AC:

  • LlmEngine provides all

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets