where the action input seems to get interrupted/truncated by a warning. That results in a Pydantic error because the tool has 2 parameters instead of 1. Because of self-healing it is later on able to overcome that by trying again this time w/o truncation. However, instead of using the full first argument, it accepts the previous, truncated one. For this example, it uses
ARGUME
instead of
ARGUMENT
I naively tried disabling the warnings but they did not disable to begin w/.
Seems to me this sort of behavior is often caused by llm’s that are not good at function calling/tool use. Try adding to your system prompt,
When you are using a tool, you MUST use valid JSON format for your input to the tool.
Sometimes this helps, sometimes not depending on the llm.
no reference. the tools need input to be structured when they are called. any llm does its best to comply with instructions and create the proper format for inputs to pass to a tool. this sometimes helps. crewai is telling the llm to do the formatting correctly based on the tool parm inputs. sometimes the llm does it correctly, sometimes not. depends on how adept the llm is at tool use.