Skip to main content
Patterns where the model returns multiple tool calls in a single response, run together.

Parallel function calling

In parallel function calling, the same function is called multiple times simultaneously with different parameters. This is more efficient than making sequential calls for similar operations.
In response, the tool_calls key of the LLM’s response will look like this:
JSON
The model returns three function calls. You can execute them programmatically to answer the user’s question.

Parallel multiple function calling

This pattern combines parallel and multiple function calling: multiple different functions are available, and one user prompt triggers multiple different function calls simultaneously. The model chooses which functions to call AND calls them in parallel.
This produces five function calls: two for stock prices (Apple and Google) and three for weather (New York, San Francisco, and Chicago), all executed in parallel.
JSON