Limit of functions that can be passed

I’m experimenting with function calling for our usecases and I was wondering if there is a limit to how many functions can be passed to the functions parameter via the API

response = openai.ChatCompletion.create(
        function_call="auto",  # auto is default, but we'll be explicit

Is there a hard limit on these? Or is there a limit on the functions description JSON that can be provided (does that get counted in the tokens limit?)

Thank you for any help

1 Like

Hi @mmark :wave:

Welcome to the OpenAI community.

There’s only a finite amount of function description that can be passed to the models.

Here’s what docs say:

Under the hood, functions are injected into the system message in a syntax the model has been trained on. This means functions count against the model’s context limit and are billed as input tokens. If running into context limits, we suggest limiting the number of functions or the length of documentation you provide for function parameters.