crewAIInc / crewAI-tools

MIT License
645 stars 217 forks source link

Some tools (TXTSearchTool,WebsiteSearchTool,...) not working correctly without direct constructor parameters #47

Open strnad opened 5 months ago

strnad commented 5 months ago

I've encountered an issue with some tools (specifically TXTSearchTool and WebsiteSearchTool, but there may be more) where they do not function correctly unless the source file or URL is passed directly to the constructor during their creation.

Steps to Reproduce:

Create an instance of the tool without passing the source file/URL directly to the constructor. Attempt to use the tool by passing the source file/URL through the agent (e.g., the agent finds and passes the URL or file path). Observe that the tool fails to find anything, even though the call appears correct and the documentation suggests that the tool should work without parameters in the constructor.

Expected Behavior:

The tools should function correctly when the source file/URL is passed by the agent after the tool's creation, as indicated by the documentation.

Actual Behavior:

The tools do not find any results when the source file/URL is passed by the agent, but they work correctly if the parameters are provided directly to the constructor.

Examples:

TXTSearchTool and WebsiteSearchTool fail to find results when used by the agent with parameters passed after creation. Directly passing the source file/URL to the constructor allows the tools to function as expected.

Environment: python: 3.10.12 (tried also 3.11 and 3.12) crewai: 0.30.11 (tried also older version and newest git version) crewai-tools: 0.2.6 (tried also newest git version) model: gpt3.5-turbo (but i tried gpt4, gpt4o, gpt4-turbo too with same result) OS: linux mint, windows 11

bug

strnad commented 5 months ago

not working:

not_working

working: working

broken_websearch_py.zip