#139 — Migrate from ChatResponseEcharts to ChatResponseWidget
Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned
Created: 2024-10-11 · Updated: 2025-09-15
Description
Need to integrate KPI tiles into Facade. Blocked by https://github.com/Twill-AI/twill-llm-engine/issues/171
Complexity here is that current “widget” table structure won’t fit to ChatResponseKPI.
We agreed with @meliascosta that instead of introducing new ChatResponseKPI we would transform ChatResponseEcharts into
class ChatResponseWidget:
"""Response with Apache ECharts code in chat."""
type: Literal["echarts", "kpi", "table"]
code: str
sql_query: str
headers: List[str]
rows: List[List[Any]]
name: str
values_update_interval_sec: intalso in scope of #141 it would have new (like) “sql_post_processor” field.
About updating widgets idea is to:
- Put results of SQL query into
rows(values_rowsin Facade and API) field shaped in the specific way. Use “sql_post_processor” function to populatevalues_rowsfrom SQL query. - If
type=kpithen reference values fromvalues_rowswhich would be the only part which is updated inwidgettable during dashboard updating.
AC:
- Facade supports
ChatResponseWidgetfrom LlmEngine output, has new column inwidgettable corresponding totype, persists it and returns in API. - Facade API is updated to:
- renaming “widget.echarts_code” to “widget
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets