[r] querychat 0.3.0
New features
-
Added a new
"visualize"tool that lets querychat render interactive charts inline in the chat. When enabled (viatools = c("filter", "query", "visualize")), the LLM can answer questions with charts by writing ggsql (SQL with aVISUALISEclause) instead of only tables. Charts can be expanded to fullscreen and their underlying query inspected. Requires theggsqlpackage andbslib >= 0.11.0. (#224) -
Added stream cancellation support. A stop button now appears during LLM streaming, allowing users to cancel in-progress responses by clicking it or pressing Escape. Cancellation is enabled by default and can be disabled via
enable_cancel = FALSEin the UI. (#241) -
Added support for Snowflake Semantic Views. When connected to Snowflake via DBI, querychat automatically discovers available Semantic Views and includes their definitions in the system prompt. This helps the LLM generate correct queries using the
SEMANTIC_VIEW()table function with certified business metrics and dimensions. (#200) -
QueryChat$new()now supports deferred data source. Passdata_source = NULLat initialization time, then provide the actual data source via thedata_sourceparameter of$server()or by setting the$data_sourceproperty. This enables use cases where the data source depends on session-specific authentication or per-user database connections. (#202) -
QueryChat$server()now accepts aclientparameter for session-scoped chat client overrides. This enables Posit Connect managed OAuth workflows where API credentials are only available inside the Shiny server function. The client spec is stored lazily at construction time and resolved only when needed, soQueryChat$new(NULL, "table")no longer requires an API key. (#205)
Improvements
-
The query tool result card now starts collapsed by default. Users can still expand it to see the SQL query and results. Set
QUERYCHAT_TOOL_DETAILS=expanded(oroptions(querychat.tool_details = "expanded")) to restore the previous behavior. (#239) -
Query suggestions generated by the LLM now render reliably as clickable cards in the chat. (#236, #238)
-
The
toolsparameter now uses"filter"as the preferred name (instead of"update") for the dashboard-filtering tool group. The default is nowc("filter", "query"). The legacy name"update"is still accepted everywhere. (#222) -
When a custom
prompt_templateis provided that doesn't contain Mustache references to{{schema}}, the expensiveget_schema()call is now skipped entirely. This allows users with large databases to avoid slow startup by providing their own prompt that includes schema information inline (or omits it). (#208)