Query databases and tables with AI assistance
Project description
datasette-query-assistant
Query databases and tables with AI assistance
Early alpha.
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-query-assistant
Configuration
Set the model ID to be used by this plugin by adding this to your Datasette configuration:
plugins:
datasette-query-assistant:
model: openai/gpt-4.1-mini
key_env_var: OPENAI_API_KEY
To use the openai/gpt-4.1-mini model you'll need to install llm-openai-plugin in addition to datasette-query-assistant.
If the model needs an API key, set the key_env_var to the name of an environment variable and ensure that environment variable is correctly set.
You can use any model that is available via an LLM plugin
Usage
Users with execute-sql permission will gain a database action menu item for "Query this database with AI assistance" which will let them ask a question and be redirected to a commented SQL query that will hopefully answer it.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-query-assistant
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
To re-generate the tests with refreshed examples from the API:
pytest -x --record-mode=rewrite --inline-snapshot=fix
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasette_query_assistant-0.1a5.tar.gz.
File metadata
- Download URL: datasette_query_assistant-0.1a5.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f3c871ab23cbd77c2cc2953a0614db6d31aee57a6921f8c0f3a1e75a4b89b14
|
|
| MD5 |
6c1e7208429def4194cf1fca60116904
|
|
| BLAKE2b-256 |
551bd7eb6671f13b272227670ab2ad8fb948cdc2a0f08e561f621da303dba504
|
Provenance
The following attestation bundles were made for datasette_query_assistant-0.1a5.tar.gz:
Publisher:
publish.yml on datasette/datasette-query-assistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_query_assistant-0.1a5.tar.gz -
Subject digest:
0f3c871ab23cbd77c2cc2953a0614db6d31aee57a6921f8c0f3a1e75a4b89b14 - Sigstore transparency entry: 684264122
- Sigstore integration time:
-
Permalink:
datasette/datasette-query-assistant@ee588baa5b9958a381f6a13a14affd484f4165ca -
Branch / Tag:
refs/tags/0.1a5 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee588baa5b9958a381f6a13a14affd484f4165ca -
Trigger Event:
release
-
Statement type:
File details
Details for the file datasette_query_assistant-0.1a5-py3-none-any.whl.
File metadata
- Download URL: datasette_query_assistant-0.1a5-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
354a248c05b774f074140c9abcd838fb1b20d83a9cf8f3861008578bdaa174db
|
|
| MD5 |
1b20655e6627eaba5912bd7ef305bbfc
|
|
| BLAKE2b-256 |
3de5dd67c760f1e02061a8dd9e24033c5c8f345644e990bd5d44b8628bf6b535
|
Provenance
The following attestation bundles were made for datasette_query_assistant-0.1a5-py3-none-any.whl:
Publisher:
publish.yml on datasette/datasette-query-assistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_query_assistant-0.1a5-py3-none-any.whl -
Subject digest:
354a248c05b774f074140c9abcd838fb1b20d83a9cf8f3861008578bdaa174db - Sigstore transparency entry: 684264125
- Sigstore integration time:
-
Permalink:
datasette/datasette-query-assistant@ee588baa5b9958a381f6a13a14affd484f4165ca -
Branch / Tag:
refs/tags/0.1a5 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee588baa5b9958a381f6a13a14affd484f4165ca -
Trigger Event:
release
-
Statement type: