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.
