Skip to content

Commit 3c9f519

Browse files
committed
Add lead-in to build article about where querychat is a good fit
1 parent 2a321a6 commit 3c9f519

File tree

2 files changed

+44
-10
lines changed

2 files changed

+44
-10
lines changed

pkg-py/docs/build.qmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ title: Build an app
44

55
While the [`.app()` method](reference/querychat.qmd#querychat.querychat.app) provides a quick way to start exploring data, building bespoke Shiny apps with querychat unlocks the full power of integrating natural language data exploration with custom visualizations, layouts, and interactivity. This guide shows you how to integrate querychat into your own Shiny applications and leverage its reactive data outputs to create rich, interactive dashboards.
66

7+
querychat is a particularly good fit for Shiny apps that have:
8+
9+
1. **A single data source** (or a set of related tables that can be joined)
10+
2. **Multiple filters** that let users slice and explore the data in different ways
11+
3. **Several visualizations and outputs** that all depend on the same filtered data
12+
13+
In these apps, querychat can replace or augment your filtering UI by allowing users to describe what they want to see in natural language. Instead of building complex filter controls, users can simply ask questions like "show me customers from California who spent over $1000 last quarter" and querychat will generate the appropriate SQL query.
14+
15+
This is especially valuable when:
16+
17+
- Your data has many columns and building a UI for all possible filters would be overwhelming
18+
- Users want to explore ad-hoc combinations of filters that you didn't anticipate
19+
- You want to make data exploration more accessible to users who aren't comfortable with traditional filtering UIs
20+
21+
If you have an existing app with a reactive data frame that flows through multiple outputs, querychat can be a natural addition to provide an alternative way to filter that data.
22+
23+
724
## Starter template
825

926
Integrating querychat into a Shiny app requires just three steps:

pkg-r/vignettes/build.Rmd

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,31 @@ knitr::opts_chunk$set(
1515
)
1616
```
1717

18-
While `querychat_app()` provides a quick way to start exploring data, building bespoke Shiny apps with QueryChat unlocks the full power of integrating natural language data exploration with custom visualizations, layouts, and interactivity. This guide shows you how to integrate QueryChat into your own Shiny applications and leverage its reactive data outputs to create rich, interactive dashboards.
18+
While `querychat_app()` provides a quick way to start exploring data, building bespoke Shiny apps with querychat unlocks the full power of integrating natural language data exploration with custom visualizations, layouts, and interactivity. This guide shows you how to integrate querychat into your own Shiny applications and leverage its reactive data outputs to create rich, interactive dashboards.
19+
20+
querychat is a particularly good fit for Shiny apps that have:
21+
22+
1. **A single data source** (or a set of related tables that can be joined)
23+
2. **Multiple filters** that let users slice and explore the data in different ways
24+
3. **Several visualizations and outputs** that all depend on the same filtered data
25+
26+
In these apps, querychat can replace or augment your filtering UI by allowing users to describe what they want to see in natural language. Instead of building complex filter controls, users can simply ask questions like "show me customers from California who spent over $1000 last quarter" and querychat will generate the appropriate SQL query.
27+
28+
This is especially valuable when:
29+
30+
- Your data has many columns and building a UI for all possible filters would be overwhelming
31+
- Users want to explore ad-hoc combinations of filters that you didn't anticipate
32+
- You want to make data exploration more accessible to users who aren't comfortable with traditional filtering UIs
33+
34+
If you have an existing app with a reactive data frame that flows through multiple outputs, querychat can be a natural addition to provide an alternative way to filter that data.
35+
1936

2037
## Starter template
2138

22-
Integrating QueryChat into a Shiny app requires just three steps:
39+
Integrating querychat into a Shiny app requires just three steps:
2340

2441
1. Initialize a `QueryChat` instance with your data
25-
2. Add the QueryChat UI component (either `$sidebar()` or `$ui()`)
42+
2. Add the UI component (either `$sidebar()` or `$ui()`)
2643
3. Use reactive values like `$df()`, `$sql()`, and `$title()` to build outputs that respond to user queries
2744

2845
Here's a starter template demonstrating these steps:
@@ -68,12 +85,12 @@ shinyApp(ui, server)
6885
```
6986

7087
::: {.alert .alert-info}
71-
You'll need to call the `qc$server()` method within your server function to set up QueryChat's reactive behavior, and capture its return value to access reactive data.
88+
You'll need to call the `qc$server()` method within your server function to set up querychat's reactive behavior, and capture its return value to access reactive data.
7289
:::
7390

7491
## Reactives
7592

76-
There are three main reactive values provided by QueryChat for use in your app:
93+
There are three main reactive values provided by querychat for use in your app:
7794

7895
### Filtered data {#filtered-data}
7996

@@ -334,7 +351,7 @@ shinyApp(ui = ui, server = server)
334351

335352
## Programmatic updates {#programmatic-filtering}
336353

337-
QueryChat's reactive state can be updated programmatically. For example, you might want to add a "Reset Filters" button that clears any active filters and returns the data table to its original state. You can do this by setting both the SQL query and title to their default values. This way you don't have to rely on both the user and LLM to send the right prompt.
354+
querychat's reactive state can be updated programmatically. For example, you might want to add a "Reset Filters" button that clears any active filters and returns the data table to its original state. You can do this by setting both the SQL query and title to their default values. This way you don't have to rely on both the user and LLM to send the right prompt.
338355

339356
```{r}
340357
ui <- page_sidebar(
@@ -368,10 +385,10 @@ This is equivalent to the user asking the LLM to "reset" or "show all data".
368385

369386
## Multiple tables
370387

371-
Currently, you have two options for exploring multiple tables in QueryChat:
388+
Currently, you have two options for exploring multiple tables in querychat:
372389

373-
1. Join the tables into a single table before passing to QueryChat
374-
2. Use multiple QueryChat instances in the same app
390+
1. Join the tables into a single table before passing to querychat
391+
2. Use multiple querychat instances in the same app
375392

376393
The first option makes it possible to chat with multiple tables inside a single chat interface, whereas the second option requires a separate chat interface for each table.
377394

@@ -440,4 +457,4 @@ shinyApp(ui, server)
440457

441458
- [Greet users](greet.html) - Create welcoming onboarding experiences
442459
- [Provide context](context.html) - Help the LLM understand your data better
443-
- [Tools](tools.html) - Understand what QueryChat can do under the hood
460+
- [Tools](tools.html) - Understand what querychat can do under the hood

0 commit comments

Comments
 (0)