This code was used in a video on 2024-08-01 to show how to use function calling with Ollama. Yes, there are two other videos on this topic, but this one covers a newer technique. Unfortunately the newer technique isn't as reliable as the older one, at least not yet. Hopefully it will be soon.
I use Bun to run this. You can find the video here: https://youtu.be/hb5iwDpsPwc