datasette / datasette-query-assistant

Query databases and tables with AI assistance
Apache License 2.0
14 stars 2 forks source link

If no API key configured, prompt the user to provide one #11

Open simonw opened 4 months ago

simonw commented 4 months ago

I use this trick for datasette-enrichments-gpt and I like it - it means I can share public demos of the plugin without needing to bake a paid API key into the demo.

I'll switch the configuration around to use the {"$env": "..."} plugin configuration mechanism. Then I'll have the query page know that if it hasn't been configured it should provide a password field for the user to enter an API key instead.

I'll persist that key in localStorage for them, like I do on https://tools.simonwillison.net/haiku