response = await client.aio.models.generate_content(
model='gemini-2.5-flash',
contents='What is weather and traffic situation in Boston?',
config=types.GenerateContentConfig(
tools=[get_current_weather, get_current_traffic],
automatic_function_calling=types.AutomaticFunctionCallingConfig(run_concurrently=True)
),
)
The problem:
Proposed solution
AutomaticFunctionCallingConfigandAutomaticFunctionCallingConfigDictwith an optional parameter (e.g.run_concurrently), which defaults toNoneif not provided.get_function_response_parts_asyncso it makes use ofasyncio.gather()ifrun_concurrentlyis set toTrue.Client-side example