I’m trying to run the scenario in this link, which is internally using
langchain_community.agent_toolkits.file_management.toolkit import FileManagementToolkit
When I run the agent i’m getting the following error
pydantic_core._pydantic_core.ValidationError: 1 validation error for Agent
Value error, Required function parameter ‘input’ not found in args_schema [type=value_error, input_value={‘allow_delegation’: Fals…ss user experiences.\n"}, input_type=dict]
I didn’t follow the decorator as I’m facing multiple pydantic issue, after all I stuck with the above one.
from crewai.tools import BaseTool
from langchain_community.agent_toolkits.file_management.toolkit import FileManagementToolkit
class LangFileManagementTools(BaseTool):
name: str = “CustomReadFileTool”
description: str = “Useful for search-based queries. Use this to find current information about markets, companies, and trends.”
def _run(self) -> [BaseTool]:
"""
Wrapper function to adapt LangChain tool to CrewAI's requirements
:param input: File path to read
:return: Contents of the file
"""
return FileManagementToolkit(root_dir='workdir', selected_tools=["read_file", "list_directory"]).get_tools()