OpenAI GPT Chat Completions API - Function Calling Explained - How does it work?

preview_player
Показать описание

--------------------

Function calling

Developers can now describe functions to gpt-4-0613 and gpt-3.5-turbo-0613, and have the model intelligently choose to output a JSON object containing arguments to call those functions. This is a new way to more reliably connect GPT's capabilities with external tools and APIs.

These models have been fine-tuned to both detect when a function needs to be called (depending on the user’s input) and to respond with JSON that adheres to the function signature. Function calling allows developers to more reliably get structured data back from the model. For example, developers can:

Create chatbots that answer questions by calling external tools (e.g., like ChatGPT Plugins)
Convert queries such as “Email Anya to see if she wants to get coffee next Friday” to a function call like send_email(to: string, body: string), or “What’s the weather like in Boston?” to get_current_weather(location: string, unit: 'celsius' | 'fahrenheit').
Рекомендации по теме
Комментарии
Автор

Finally a good breakdown, everybody else is like "here's the weather in Boston."

laptopuser
Автор

This was the most clear explanation I have seen on function calling. Thank you!

yesterwhere
Автор

Great visual! Better explained in 5 minutes than some 20 min. videos I've seen. Thank you.

MannyBernabe
Автор

Best description so far if you are not a softwarecdeveloper. Thanks.

ruslan
Автор

Absolutely excellent! Finally a crystal clear explanation! Thank you 😊

yourbestsail
Автор

Thank you very much for sharing this explanation.

DaveBayless
Автор

A very clear explanation in 5 minutes! You're a rockstar!

sashirestela
Автор

Awesome breakdown! Keep up the great work!

alexpietropaolo
Автор

The best explanation on the internet. Thank you so much!

AlgorithmicEchoes
Автор

Excellent explanation. Best I've seen so far on this topic. Thanks.

ac_cobra
Автор

Thank you for this!
I'm working on a presentation for my company in using ChatGPT to automate some critical internal processes and this way extremely helpful

ccnomz
Автор

Excellent explanation. Please keep up the good work.

ShahidMogul
Автор

🎯 Key Takeaways for quick navigation:

00:00 📣 OpenAI has introduced function calling for people who want to create their own chat interfaces using the OpenAI API.
00:29 🗣️ A user can enter a prompt in the chat interface, for example, a query about a hotel in a specific location.
00:42 🧬 An API call is made to OpenAI, combining the user's prompt and descriptions of certain functions to enable OpenAI to extract more information.
01:20 🚀 OpenAI analyzes the user's text to determine which function should be used, matching the semantic meaning of the user's prompt with the descriptions of the functions.
02:29 🏨 An example of a function used in place, "get top 10 hotels", is triggered when a user asks for the best hotels matching their specified criteria.
03:35 👀 Based on the user prompt, OpenAI extracts relevant parameters, such as the city and neighborhood mentioned by the user, to pass back to the code.
04:18 ↩️ The code uses the name of the function to determine which APIs to call and the parameters give specific inputs to the API.
05:11 🔄 The output usually needs refining to make it less machine-like, so it is often sent back to OpenAI along with the original user prompt. OpenAI then crafts a more natural, well-worded response for the user.

Made with HARPA AI

francycharuto
Автор

Thanks, can you please share with us the drawing you showed?

ofir