I’m trying to use the “gemini-2.0-flash-exp” model, but I keep getting the error below. However, when I switch to “gemini-1.5-flash”, everything works fine.
Has anyone encountered this issue before and can help me?
pgsql
CopiarEditar
in _get_llm_response
raise ValueError("Invalid response from LLM call - None or empty.")
ValueError: Invalid response from LLM call - None or empty.
Hey @rokbenko, that happens to me too. Sometimes it works and sometimes it doesn’t. I’m using the Tier 1 Gemini API to get more RPM, but I’m still experiencing this problem. Do you have any suggestions on what we need to do?
I use the Gemini family of LLMs quite a bit, especially for tasks that don’t require specialization. I use them both through Vertex and OpenRouter. In both cases, I also see this issue. But it’s kind of hard to reproduce, since it doesn’t always happen.
However, at least in my case, it tends to happen in tasks that have an output_pydantic set. I haven’t dug into the code yet to try to debug where exactly the problem starts, but I have a hunch about how output_pydantic is passed. I can reduce the occurrences by reinforcing, in expected_output, the names of the keys used in the Pydantic model. Finally, I always set max_iter=3 on agents that will perform tasks with structured output. This has allowed me to complete tasks, even if some error like this eventually pops up.