Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lirockyzhang opened this issue Jul 12, 2024 · 18 comments
Closed

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

lirockyzhang opened this issue Jul 12, 2024 · 18 comments

Comments

@lirockyzhang
Copy link

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.

@nehiljain
Copy link

I am having the same issue

@lz-chen
Copy link

lz-chen commented Jul 12, 2024

Same here. I'm using tools from llamaindex as in the documentation

@1WorldCapture
Copy link

+1, using latest version:
crewai 0.36.0
crewai-tools 0.4.8

I'm using YoutubeVideoSearchTool from crewai[tools]

@lirockyzhang
Copy link
Author

lirockyzhang commented Jul 13, 2024

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.

@1WorldCapture
Copy link

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

@lz-chen
Copy link

lz-chen commented Jul 13, 2024

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 worked for me as well

@deepaknr
Copy link

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

worked for me. thanks

@mastiffai
Copy link

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)

@madhavthaker1
Copy link

^ I'm having the same issue

@madhavthaker1
Copy link

Downgrading to "langchain-openai==0.1.14" worked for me

@TusharP05
Copy link

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 same issue!

@Nolanjue
Copy link

I wonder why these libraries keep breaking with issues like these locally but different AI IDE's like lightning AI and maybe collab are fine. Perhaps its a sync reason? not quite sure.

@Nolanjue
Copy link

nvm, you need to uninstall crewai and install it again to 0.41.1, They changed certain features i assume, especially the execute() -> execute_sync(), (or execute_async())

@brycecf
Copy link

brycecf commented Aug 7, 2024

@lirockyzhang Why is this closed?

Given CrewAI is heavily built on top of LangChain, pinning CrewAI's primary dependency is not a long-term solution. This needs to be reopened.

@1WorldCapture
Copy link

@lirockyzhang Why is this closed?

Given CrewAI is heavily built on top of LangChain, pinning CrewAI's primary dependency is not a long-term solution. This needs to be reopened.

+1, I also think this dependency issue should be solved instead of walkaround.

@joaomdmoura
Copy link
Collaborator

agree, we are removing the dependency on langchain given how much we had to re-write it, but to support langchain tools we still need some connecting tissue, thanks for flagging @brycecf
I believe we fixed this tho on the crewAI side itself, could you try using a more up to date version of crewAI itself to double check if this is still the case?

@syedame1
Copy link

syedame1 commented Oct 5, 2024

I am still facing same issue even with the latest crewAI update, tools are working fine. The same code works well in visual studio. I am facing this issue in Jupyter notebook

[DEBUG]: == Working Agent: Senior Database Developer

Entering new CrewAgentExecutor chain...
I need to check the policy status and coverage details for the user mentioned in I am David Anderson, and I want to check my policy status and coverage. in the InsurancePolicies table.

Action: check_sql
Action Input: {"sql_query": "SELECT policy_status, coverage_details FROM InsurancePolicies WHERE user_name = 'David Anderson'"}

I encountered an error while trying to use the tool. This was the error: StructuredTool._run() missing 1 required keyword-only argument: 'config'.
Tool check_sql accepts these inputs: check_sql(sql_query: 'string') - Use this tool to double check if your query is correct before executing it. Always use this tool before executing a query with execute_sql.

@TANISHQBEDI
Copy link

Hey i still have this issue. I was following this tutorial
https://github.com/curiousily/AI-Bootcamp/blob/master/14.sql-agents-with-llama3-crewai.ipynb
I made the agents as in the notebook but when i finally run it using crew.kickoff i get the error

I encountered an error while trying to use the tool. This was the error: StructuredTool._run() missing 1 required keyword-only argument: 'config'.
Tool list_tables accepts these inputs: list_tables() - List the available tables in the database

I am using my own data set by converting csv files to a db. and when i invoke the tool individually it runs and gives the output. I have degraded the versions as specified above.

!pip -qqq install langchain-core==0.2.15 --progress-bar off
!pip -qqq install langchain==0.2.6 --progress-bar off
!pip -qqq install langchain-community==0.2.6 --progress-bar off
!pip -qqq install 'crewai[tools]'==0.41.1 --progress-bar off
!pip -qqq install langchain-groq==0.1.5 --progress-bar off
!pip -qqq install langchain-experimental==0.0.61 --progress-bar off

just for your reference i am using the above versions. How can i fix it any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests