Issues with Gemini 1.5 Flash API Performance

We are currently working with the Gemini 1.5 Flash API in conjunction with the SQL Query Agent. However, we are encountering significant inconsistencies in its behavior.

Unpredictable Performance: While the API occasionally responds correctly, it often takes an excessive amount of time—sometimes exceeding five to 15 minutes to provide a response.

Failure Scenarios: There are instances where the API fails outright, providing no output or returning incomplete results.

Output Variability: Even when the API functions, the responses lack consistency, with noticeable variations in the results across multiple requests made under similar conditions.

These issues are impacting our ability to effectively use the Gemini 1.5 Flash API for its intended purpose. We would appreciate guidance or solutions to address these challenges to ensure smoother integration and operation.