How to Use The GPT-4 API With Function Calling | Your Own ChatGPT Plugins | TypeScript

How to Use The GPT-4 API With Function Calling | Your Own ChatGPT Plugins | TypeScript

OpenAI just released a massive update to the GPT-3.5 and GPT-4 API's! PS. If you want to unlock all the power of ChatGPT, grab my prompt engineering guide here: https://samyn.co/prompt-alchemy/ Just like you have plugins in ChatGPT, now this functionality is available to all developers. You do it by giving the API a list of functions that it can invoke. Then, the assistant response can either be a direct response or a function cal. You then execute the function, give back the results into another call to GPT and you can use the final result as an natural language response. In this video I'll show you what changed in the API and how you can use it, in TypeScript. 00:00 - Introduction: What Happened? 00:41 - How It Used To Be 03:17 - Using the updated Chat Completion API 03:49 - New request parameters: functions and function_call 04:33 - The functions array 05:56 - New return value: assistant message with function_call 07:23 - Adding your function results back into the AI 07:58 - Gotcha: Repeating the function_call message 08:59 - Recap 09:58 - Conlusion