Error parsing LLM output, agent will retry: I did it wrong. Invalid Format: I missed the ‘Action:’ after ‘Thought:’

Hi all, I get the below error. I looked here and there where a few reasons for this: using a too small model or too long prompts. Both don’t seem to be the case here. I use gpt4o for example. And even this error doesn’t always occur, but occasionally.

I am using CrewAI 0.80. I can’t remember I got this error in earlier versions.

Below you see the error, which gets in an infinite loop:

e[00m

e[91m Error parsing LLM output, agent will retry: I did it wrong. Invalid Format: I missed the ‘Action:’ after ‘Thought:’. I will do right next, and don’t use a tool I have already used.

If you don’t need to use any more tools, you must give your best complete final answer, make sure it satisfy the expect criteria, use the EXACT format below:

Thought: I now can give a great answer

Final Answer: my best complete final answer to the task.

Hope someone knows any other measures to take.

Cheers!

@Raja_Speet There can be two reasons:

  • Such an error can happen because of the LLM you’re using (source). Unfortunately, smaller LLMs sometimes struggle to work with CrewAI. Try to switch the LLM to a more capable one.
  • Such an error can happen because the task configuration is too long or strong (source), which changes some internal CrewAI keywords like action, thought, etc. Try to rephrase the task configuration.
1 Like