This would likely have to be a pure JavaScript feature. Any time we display an error on that page e.g. https://datasette.io/content?sql=select+*+from+assts we could provide a button for "Help from the AI assistant" which runs a prompt with the SQL and the error to try and suggest a fix.
This could include quite a bit of prose, and every ```sql...``` block could have a little "try this" button that copies the SQL out into the textarea and submits the form.
This would likely have to be a pure JavaScript feature. Any time we display an error on that page e.g. https://datasette.io/content?sql=select+*+from+assts we could provide a button for "Help from the AI assistant" which runs a prompt with the SQL and the error to try and suggest a fix.