Optimize prompt for parallel function calling

I am building an agent that needs to make a potentially large number of parallel function calls.

Expected behavior:

  • User: Here is my grocery shopping list: … (20 items)
  • Agent: Calls function search_product(description) 20 times

This typically works well with GPT4-Turbo, but with GPT3.5, I would say it works half the time (it typically calls search_product() once the first time, and then keeps going sequentially in the rest of the conversation).

I wonder if you would have some recommendation to make this work more consistently by adding instructions to the system prompt. For example I tried adding “Call functions simultaneously rather than sequentially when possible”, but hard to say if it makes a difference.