From 06ebb42536df98af6f81c14d7a48ba2103568a9e Mon Sep 17 00:00:00 2001 From: Daniel Chen Date: Fri, 23 May 2025 15:53:11 -0700 Subject: [PATCH 1/3] add a few more clarifications in sections --- python-package/README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/python-package/README.md b/python-package/README.md index ccff24732..cdbd5f52d 100644 --- a/python-package/README.md +++ b/python-package/README.md @@ -93,6 +93,26 @@ Currently, querychat uses DuckDB for its SQL engine. It's extremely fast and has When the querychat UI first appears, you will usually want it to greet the user with some basic instructions. By default, these instructions are auto-generated every time a user arrives; this is slow, wasteful, and unpredictable. Instead, you should create a file called `greeting.md`, and when calling `querychat.init`, pass `greeting=Path("greeting.md").read_text()`. +You can provide suggestions to the user by using the ` ` tag. + +For example: + +```markdown +* **Filter and sort the data:** + * Show only survivors + * Filter to first class passengers under 30 + * Sort by fare from highest to lowest + +* **Answer questions about the data:** + * What was the survival rate by gender? + * What's the average age of children who survived? + * How many passengers were traveling alone? +``` + +These suggestions appear in the greeting and automatically populate the chat text box when clicked. +This gives the user a few ideas to explore on their own. +You can see this behavior in our [`querychat template`](https://shiny.posit.co/py/templates/querychat/). + If you need help coming up with a greeting, your own app can help you! Just launch it and paste this into the chat interface: > Help me create a greeting for your future users. Include some example questions. Format your suggested greeting as Markdown, in a code block. @@ -116,10 +136,14 @@ If you give querychat your dataset and nothing else, it will provide the LLM wit - Column names - DuckDB data type (integer, float, boolean, datetime, text) -- For text columns with less than 10 unique values, we assume they are categorical variables and include the list of values +- For text columns with less than 10 unique values, we assume they are categorical variables and include the list of values. This threshold is configurable. - For integer and float columns, we include the range -And that's all the LLM will know about your data. If the column names are usefully descriptive, it may be able to make a surprising amount of sense out of the data. But if your data frame's columns are `x`, `V1`, `value`, etc., then the model will need to be given more background info--just like a human would. +And that's all the LLM will know about your data. +The actual data does not get passed into the LLM. +We calculate these values before we pass the schema information into the LLM. + +If the column names are usefully descriptive, it may be able to make a surprising amount of sense out of the data. But if your data frame's columns are `x`, `V1`, `value`, etc., then the model will need to be given more background info--just like a human would. To provide this information, use the `data_description` argument. For example, if you're using the `titanic` dataset, you might create a `data_description.md` like this: @@ -210,4 +234,6 @@ For a complete working example, see the [examples/app.py](examples/app.py) file - Reading greeting and data description from files - Setting up the querychat configuration - Creating a Shiny UI with the chat sidebar -- Displaying the filtered data in the main panel \ No newline at end of file +- Displaying the filtered data in the main panel + +If you have Shiny installed, and want to get started right away, you can use our [querrychat template](https://shiny.posit.co/py/templates/querychat/). From ba8f3d01b739efa95288ad5f25ba09e421185535 Mon Sep 17 00:00:00 2001 From: Daniel Chen Date: Fri, 23 May 2025 16:07:05 -0700 Subject: [PATCH 2/3] add link to sidebot template --- python-package/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-package/README.md b/python-package/README.md index cdbd5f52d..32384a17f 100644 --- a/python-package/README.md +++ b/python-package/README.md @@ -236,4 +236,7 @@ For a complete working example, see the [examples/app.py](examples/app.py) file - Creating a Shiny UI with the chat sidebar - Displaying the filtered data in the main panel -If you have Shiny installed, and want to get started right away, you can use our [querrychat template](https://shiny.posit.co/py/templates/querychat/). +If you have Shiny installed, and want to get started right away, you can use our +[querrychat template](https://shiny.posit.co/py/templates/querychat/) +or +[sidebot template](https://shiny.posit.co/py/templates/sidebot/). From 8787a5da623c62c742776e75561b08578a1dea68 Mon Sep 17 00:00:00 2001 From: Joe Cheng Date: Tue, 27 May 2025 09:48:03 -0700 Subject: [PATCH 3/3] Fix typo --- python-package/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-package/README.md b/python-package/README.md index 32384a17f..be8057ea0 100644 --- a/python-package/README.md +++ b/python-package/README.md @@ -237,6 +237,6 @@ For a complete working example, see the [examples/app.py](examples/app.py) file - Displaying the filtered data in the main panel If you have Shiny installed, and want to get started right away, you can use our -[querrychat template](https://shiny.posit.co/py/templates/querychat/) +[querychat template](https://shiny.posit.co/py/templates/querychat/) or [sidebot template](https://shiny.posit.co/py/templates/sidebot/).