crewAI: Call Tool Error: StructuredTool._run() missing 1 required

Here is the code I have for using the hierarchical process:

crew = Crew(
  agents=[researcher,classifier,allrounder],
  tasks=[integrated_task],
  process=Process.hierarchical,  # Specifies the hierarchical management approach
  memory=True,  # Enable memory usage for enhanced task execution
  manager_agent=manager
)

crew.kickoff()

However, no matter what langauge model I use, the following error keeps reoccurring:

> Entering new CrewAgentExecutor chain...
I need to scrape the primary website and gather relevant information about the company's industry, specialties, and other details. I will delegate this task to the Research Analyst.

Action: Delegate work to coworker
Action Input: {"task": "Scrape the primary website and gather relevant information about the company's industry, specialties, and other details", "context": "The company's primary website is http://www.xxxxxxxx.com/.", "coworker": "Research Analyst"} 

I encountered an error while trying to use the tool. This was the error: StructuredTool._run() missing 1 required keyword-only argument: 'config'.
 Tool Delegate work to coworker accepts these inputs: Delegate a specific task to one of the following coworkers: [Research Analyst]
The input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.

Then I changed the process back to sequential, but this error(I encountered an error while trying to use the tool. This was the error: StructuredTool._run() missing 1 required keyword-only argument: ‘config’.) still occurs whenever an agent tries to call on tools.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 8
  • Comments: 18

Most upvoted comments

Pretty sure the problem is caused by a change from Langhian. They added config as a required parameter for _run(). More detailed information can be found here: Pull Request and Commit.

Yes, I could confirm that this issue will no longer exist after I downgrade: langchain-core to 0.2.15 langchain to 0.2.6 langchain-community to 0.2.6

Downgrading to “langchain-openai==0.1.14” worked for me

Still receiving same error.

Downgrade to langchain-core to 0.2.15 langchain to 0.2.6 langchain-community to 0.2.6 results in:

ImportError: cannot import name ‘tool_call_chunk’ from ‘langchain_core.messages.tool’ (/usr/local/lib/python3.11/site-packages/langchain_core/messages/tool.py)

Pretty sure the problem is caused by a change from Langchain, specifically Langchain-core. They added config as a required parameter for _run(). More detailed information can be found here: Pull Request and Commit.