400: model generated too many tool calls

I am getting this error while using the example code for file_search_stores and a 4,000 line text file (120KB). Adding the error code text back into the prompt did not change the behavior.

google.genai._gaos.lib.compat_errors.BadRequestError: Error code: 400 - {'error': {'message': 'Model generated
too many tool calls. Please retry the request. If the issue persists, include this error message in the retry prompt to
allow the model to call a valid number of tools.', 'code': 'Model generated function call(s).'}}

Is there a direct parameter to limit the number of model calls?