←back to thread

Getting AI to write good SQL

(cloud.google.com)
478 points richards | 1 comments | | HN request time: 0.599s | source
Show context
hakanito ◴[] No.44012780[source]
The game changer for me will be when AI stops hallucinating SDK methods. I often find myself asking ”show me how to do advanced concept X in somewhat niche Y sdk”, and while it produces confident answers, 90% of the time it is suggesting SDK methods that do not exist, so a lot of time is wasted just arguing about that
replies(4): >>44012808 #>>44012853 #>>44013192 #>>44016229 #
M4v3R ◴[] No.44012808[source]
The current method of solving this is providing the AI with the documentation of the SDKs your code uses. Current LLMs have quite big context windows so you can feed them a lot of documentation. Some tools can even crawl multipage documentation and index them for the use of LLMs.
replies(1): >>44012939 #
hakanito ◴[] No.44012939[source]
How do you do that practically/reliably? Would be great to just paste a link to the SDK Github repo, but doesn't seem to work (yet) in my experience
replies(3): >>44012975 #>>44014001 #>>44018212 #
1. beala ◴[] No.44018212[source]
You can do this with Cursor. If your docs are at example.com, simply type "@example.com" and it will go read that webpage.

I've even had luck simply dropping an entire OpenAPI spec into my repo and adding the file to the context window (also using the @ command).