#function calling

1 messages · Page 1 of 1 (latest)

limpid wind
#

i got a project to do function calling to dall e api as the response. is that possible because when i look at the documentation it says only chat gpt models are supported or trained with function calling data

rough quiverBOT
#

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

#

Yes, you're correct. According to the OpenAI documentation, function calling is supported with certain models, including 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 source (https://platform.openai.com/docs/guides/function-calling).

In an API call, you can describe functions and have the model intelligently choose to output a JSON object containing arguments to call one or many functions. The Chat Completions API does not call the function; instead, the model generates JSON that you can use to call the function in your code source (https://platform.openai.com/docs/guides/function-calling).

Here's a basic sequence of steps for function calling:

  1. Call the model with the user query and a set of functions defined in the functions parameter.

Please note that the model itself does not call the function. It generates a JSON object that you can use to call the function in your code. Your application backend then makes the appropriate API call or database query, and the response from this API call is sent back to the model source (https://community.openai.com/t/398496).

For example, you can convert natural language into API calls, like converting "Who are my top customers?" to get_customers(min_revenue: int, created_before: string, limit: int) and call your internal API source (https://platform.openai.com/docs/guides/function-calling).

#

Remember to build in user confirmation flows before taking actions that impact the world on behalf of users (sending an email, posting something online, making a purchase, etc) source (https://platform.openai.com/docs/guides/function-calling).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@limpid wind kapa.ai is still learning and improving, please let us know how it did by reacting below