Top answer in this Stack Overflow thread suggests that self-installed Python doesn't have access to OS-held certificates.
See if you can find the Read Me file mentioned to check that's still the case and that the command line fix is still approriate, and when I've finished erase/installing the Mini I'm working on I'll try a fresh Python install on it.
How did you install your Python? Package from python.org, Xcode CLI Tools, homebrew, something else? I'll try the same in case different methods give different results.
I applied the fix in the Python app folder, and no longer have SSH errors. Now I just get never-ending "Too many requests" errorsâI've only tried to launch it about five times, a minute or so apart each time. Same response on every run.
I think I installed via Homebrew, and there's a Python 3.12 folder in my Applications folder. Inside that is an Install Certificates.command file; I double-clicked it.
That sounds more like the .pkg installer from python.org
I've just brew install python on the cleaned-up Mini and, interestingly:
...
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2024-
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/c431e0186df2ccc2ea942b34a3c26c2cebebec8e07ad6abdae48447a52c5f506--ca-certificates-2024-03-11.bottle_manifest.json
==> Pouring ca-certificates--2024-03-11.all.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
đș /usr/local/Cellar/ca-certificates/2024-03-11: 4 files, 232.3KB
...
...which suggests that the Python 3.12.3 homebrew install on Sonoma includes the post-install script.
I've no API key, but spoofing one in a suitably-doctored version of @strackerphil's Python script from above gets me
...and if I've got my head round this, (probably not!) that means I'm getting past certificate validation then failing on API auth, showing the root certs are available to Python.
...spending money -- AFAIK (see here) API use is no longer free (although you may get some free credit on first signing up, I believe that has a 3-month expiration date).
Ah, that'd do it. Odd they don't even bring that up on the page where you generate your API key (which you can do as long as you have an account, even a free account).
I find this all very interesting, and I'm very tempted to try it out. Adding this sort of utility to KM could be a big game changer, BUT in about three weeks Apple will hold WWDC and there's a fairly good chance that they will be announcing new ways for Apple users (including iOS and macOS users) to use AI in all its platforms. (Although it's likely to become available only in a few months.) Based on some rumours, I'm guessing that Apple will have free hooks in its OSs to allow users to access OpenAI's services without needing to create any account with OpenAI.
As a result I'm just going to hold off a little while longer to see what Apple does. But in the meantime I'm certainly going to ponder what I would like AI to do for me within the KM world.