#what is function calling

1 messages · Page 1 of 1 (latest)

drifting burrow
#

what is function calling ?

round brambleBOT
#

Hi @drifting burrow. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Function calling in the context of OpenAI's API is a feature that allows you to describe functions in an API call. The model can then intelligently choose to output a JSON object containing arguments to call one or many functions. It's important to note that the Chat Completions API does not actually call the function; instead, the model generates JSON that you can use to call the function in your code.

Function calling is supported with specific models such as gpt-4, gpt-4-turbo-preview, gpt-4-0125-preview, gpt-4-1106-preview, gpt-4-0613, gpt-3.5-turbo, gpt-3.5-turbo-0125, gpt-3.5-turbo-1106, and gpt-3.5-turbo-0613. Additionally, parallel function calls are supported on certain models.

Function calling can be used to more reliably get structured data back from the model. For example, you can create assistants that answer questions by calling external APIs, convert natural language into API calls, or extract structured data from text.

There are also ways to fine-tune the function calling process to increase its accuracy and reliability. This can involve improvements to the function definitions, experimenting with prompt engineering, or fine-tuning the model for function calling.

For more detailed information, you can refer to the OpenAI's function calling guide (https://platform.openai.com/docs/guides/function-calling) and the OpenAI Cookbook's example on fine-tuning for function calling (https://cookbook.openai.com/examples/fine_tuning_for_function_calling).