Kevin Whinnery
banner
kevin.mn
Kevin Whinnery
@kevin.mn
Developer Experience @ OpenAI. Previously DevRel for Twilio, Deno, Retool.

https://www.kevin.mn/
Likely unintentional- tracking g on a GitHub issue?
March 10, 2025 at 1:29 PM
I like Christmas... but I find no fault in this plan either 💡
a black and white photo of a woman standing in front of a mirror and saying `` i mean ... '' .
ALT: a black and white photo of a woman standing in front of a mirror and saying `` i mean ... '' .
media.tenor.com
December 25, 2024 at 1:23 AM
This flow is how you can provide a model external data to use for generations, or allow a model to control any external system programmatically. Here's the full example I just showed, usable in Node or @deno.land:

Code: gist.github.com/kwhinnery/a6...

Docs:
platform.openai.com/docs/guides/...
Function calling in four acts. A simple but complete soup-to-nuts example of function calling with the OpenAI API.
Function calling in four acts. A simple but complete soup-to-nuts example of function calling with the OpenAI API. - example.js
gist.github.com
November 27, 2024 at 4:14 PM
4️⃣ Finally, make another call to the model containing the previous prompts and messages we sent, plus the function call message sent by the model after the first request, and our response.

Now the model can generate a response for the user!
November 27, 2024 at 4:14 PM
3️⃣ In this case, the model correctly decides it should call the "generate_horoscope" function. Instead of a text response, the model returns a message containing a JSON string of data that should be passed in to a function call in your code.
November 27, 2024 at 4:14 PM
2️⃣ Generate output from the model based on a prompt. Depending on the content of the prompt, the model may decide to call a function that you provide to it.
November 27, 2024 at 4:14 PM
1️⃣ Define a list of functions the model could decide to call based on a prompt. We provide only one function that expects an astrological sign in an input object.
November 27, 2024 at 4:14 PM