-
Notifications
You must be signed in to change notification settings - Fork 22
feat(pkg-r): website improvements #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cpsievert
wants to merge
20
commits into
main
Choose a base branch
from
feat/r-new-site
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,324
−561
Open
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
aabd481
feat(pkg-r): website improvements
cpsievert f824a02
`devtools::document()` (GitHub Actions)
cpsievert 2f1f887
fix: check; remove old index.md file
cpsievert 025e1a7
Consistent capitalization
cpsievert de42a05
Update pkg-r/README.md
cpsievert 13d115a
Update pkg-r/vignettes/build.Rmd
cpsievert 20090c0
fix: grammar
cpsievert 53c637d
`usethis::use_tidy_description()` (GitHub Actions)
cpsievert 989d831
Update pkg-py/docs/build.qmd
cpsievert d4fc0ae
docs: address 1st round feedback from PR #162
cpsievert 076a460
fix: lint checks
cpsievert e8cc12e
Revisit 'how it works' section
cpsievert dbd5967
Apply suggestions from code review
cpsievert e0c1036
docs: apply similar text improvements to Python docs
cpsievert 32c66dd
docs: address Phase 1 PR feedback (quick wins)
cpsievert 2dadb9b
docs: use querychat() instead of querychat_app() in R vignettes
cpsievert 4fe3429
Consistently use querychat() as the constructor in data-sources.Rmd
cpsievert 2a321a6
Update model recommendations
cpsievert 3c9f519
Add lead-in to build article about where querychat is a good fit
cpsievert eaa9324
fix: more QueryChat -> querychat
cpsievert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,7 @@ | ||
| # querychat: Chat with your data in any language | ||
| # querychat <a href="https://posit-dev.github.io/querychat/"><img src="pkg-r/man/figures/logo.png" align="right" height="138" alt="querychat website" /></a> | ||
|
|
||
| querychat is a multilingual package that allows you to chat with your data using natural language queries. It's available for: | ||
| QueryChat facilitates safe and reliable natural language exploration of tabular data, powered by SQL and large language models (LLMs). | ||
|
|
||
| - [R - Shiny](pkg-r/README.md) | ||
| - [Python - Shiny for Python](pkg-py/README.md) | ||
| To get started, see the [official website](https://posit-dev.github.io/querychat/). | ||
|
|
||
| ## Overview | ||
|
|
||
| Imagine typing questions like these directly into your dashboard, and seeing the results in realtime: | ||
|
|
||
| * "Show only penguins that are not species Gentoo and have a bill length greater than 50mm." | ||
| * "Show only blue states with an incidence rate greater than 100 per 100,000 people." | ||
| * "What is the average mpg of cars with 6 cylinders?" | ||
|
|
||
| querychat is a drop-in component for Shiny that allows users to query a data frame using natural language. The results are available as a reactive data frame, so they can be easily used from Shiny outputs, reactive expressions, downloads, etc. | ||
|
|
||
| |  | | ||
| |-| | ||
|
|
||
| [Live demo](https://jcheng.shinyapps.io/sidebot/) | ||
|
|
||
| **This is not as terrible an idea as you might think!** We need to be very careful when bringing LLMs into data analysis, as we all know that they are prone to hallucinations and other classes of errors. querychat is designed to excel in reliability, transparency, and reproducibility by using this one technique: denying it raw access to the data, and forcing it to write SQL queries instead. | ||
|
|
||
| ## How it works | ||
|
|
||
| ### Powered by LLMs | ||
|
|
||
| querychat's natural language chat experience is powered by LLMs (like GPT-4o, Claude 3.5 Sonnet, etc.) that support function/tool calling capabilities. | ||
|
|
||
| ### Powered by SQL | ||
|
|
||
| querychat doesn't send the raw data to the LLM, asking it to guess summary statistics. Instead, the LLM generates precise SQL queries to filter the data or directly calculate statistics. This is crucial for ensuring relability, transparency, and reproducibility: | ||
|
|
||
| - **Reliability:** Today's LLMs are excellent at writing SQL, but bad at direct calculation. | ||
| - **Transparency:** querychat always displays the SQL to the user, so it can be vetted instead of blindly trusted. | ||
| - **Reproducibility:** The SQL query can be easily copied and reused. | ||
|
|
||
| Currently, querychat uses DuckDB for its SQL engine when working with data frames. For database sources, it uses the native SQL dialect of the connected database. | ||
|
|
||
| ## Language-specific Documentation | ||
|
|
||
| For detailed information on how to use querychat in your preferred language, see the language-specific READMEs: | ||
|
|
||
| - [R Documentation](pkg-r/README.md) | ||
| - [Python Documentation](pkg-py/README.md) | ||
| Or, the README for [R](pkg-r/README.md) and [Python](pkg-py/README.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,50 @@ | ||
| # querychat for Python | ||
| # querychat <a href="https://posit-dev.github.io/querychat/py/"><img src="https://posit-dev.github.io/querychat/images/querychat.png" align="right" height="138" alt="querychat website" /></a> | ||
|
|
||
| Please see [the package documentation site](https://posit-dev.github.io/querychat/py/index.html) for installation, setup, and usage. | ||
| <p> | ||
| <!-- badges start --> | ||
| <a href="https://pypi.org/project/querychat/"><img alt="PyPI" src="https://img.shields.io/pypi/v/querychat?logo=python&logoColor=white&color=orange"></a> | ||
| <a href="https://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a> | ||
| <a href="https://pypi.org/project/querychat"><img src="https://img.shields.io/pypi/pyversions/querychat.svg" alt="versions"></a> | ||
| <a href="https://github.com/posit-dev/querychat"><img src="https://github.com/posit-dev/querychat/actions/workflows/test.yml/badge.svg?branch=main" alt="Python Tests"></a> | ||
| <!-- badges end --> | ||
| </p> | ||
|
|
||
| If you are looking for querychat python examples, | ||
| you can find them in the `examples/` directory. | ||
|
|
||
| QueryChat facilitates safe and reliable natural language exploration of tabular data, powered by SQL and large language models (LLMs). For analysts, it offers an intuitive web application where they can quickly ask questions of their data and receive verifiable data-driven answers. For software developers, QueryChat provides a comprehensive Python API to access core functionality -- including chat UI, generated SQL statements, resulting data, and more. This capability enables the seamless integration of natural language querying into bespoke data applications. | ||
|
|
||
| ## Installation | ||
|
|
||
| You can install the package from PyPI using pip: | ||
| Install the latest stable release [from PyPI](https://pypi.org/project/querychat/): | ||
|
|
||
| ```bash | ||
| pip install querychat | ||
| ``` | ||
|
|
||
| Or you can install querychat directly from GitHub: | ||
| ## Quick start | ||
|
|
||
| ```bash | ||
| pip install "querychat @ git+https://github.com/posit-dev/querychat" | ||
| The main entry point is the [`QueryChat` class](https://posit-dev.github.io/querychat/py/reference/QueryChat.html). It requires a [data source](https://posit-dev.github.io/querychat/py/data-sources.html) (e.g., pandas, polars, etc) and a name for the data. | ||
|
|
||
| ```python | ||
| from querychat import QueryChat | ||
| from querychat.data import titanic | ||
|
|
||
| qc = QueryChat(titanic(), "titanic") | ||
| app = qc.app() | ||
| # app.run() | ||
| ``` | ||
|
|
||
| <p align="center"> | ||
| <img src="docs/images/quickstart.png" alt="QueryChat interface showing natural language queries" width="85%"> | ||
| </p> | ||
|
|
||
| ## Custom apps | ||
|
|
||
| Build your own custom web apps with natural language querying capabilities, such as [this one](https://github.com/posit-conf-2025/llm/blob/main/_solutions/25_querychat/25_querychat_02-end-app.R) which provides a bespoke interface for exploring Airbnb listings: | ||
|
|
||
| <p align="center"> | ||
| <img src="docs/images/airbnb.png" alt="A custom app for exploring Airbnb listings, powered by QueryChat." width="85%"> | ||
| </p> | ||
|
|
||
| ## Learn more | ||
|
|
||
| See the [website](https://posit-dev.github.io/querychat/py) to learn more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.