Open ChristianJohnston97 opened 4 months ago
I've been having problems with my tools as well not sure why my search tool decided to stop working along with every other tool.
@theCyberTech any thoughts? This is quite a big issue when using tools.
i have the same issue with build-in FileWriteTool. crewai version: 0.63.2 crewai-tools 0.12.1 Python 3.12.6 langchain 0.2.16 Windows 11
# Agent: Thinker
## Thought: Thought: I need to write content to a specified TXT file to meet the given criteria.
## Using tool: File Writer Tool
## Tool Input:
"{\"filename\": \"important_document.txt\", \"content\": \"This is the content of the important document that must be written to the file.\", \"overwrite\": true}"
## Tool Output:
Error: the Action Input is not a valid key, value dictionary.
i think that https://github.com/crewAIInc/crewAI/issues/1344 is connected with the issue
I would recommend build tools using the from crewai_tools import BaseTool
class - https://docs.crewai.com/how-to/Create-Custom-Tools/
@voytas75 I think this might be not related, but could you try on the new version 0.63.6 ?
@joaomdmoura this error still occurs on 0.63.6
I will just add that now, as in previous versions, calling the tool directly creates a file:
from crewai_tools import FileWriterTool
file_writer_tool = FileWriterTool()
input_args = {
'filename': "test.txt",
'content': "test content",
'directory': "c:\\temp",
'overwrite': True,
'encoding': 'utf-8'
}
file_writer_tool._run(** input_args)
Nice testing it today, what model you're using so I can use the same?
crewai version: 0.64
the same issue as earlier https://github.com/crewAIInc/crewAI/issues/923#issuecomment-2371935965
@ChristianJohnston97 what about you custom tool?
Thanks for the crew gist I'll look into this one soon
crewai version: 0.70.1
the same issue as earlier https://github.com/crewAIInc/crewAI/issues/923#issuecomment-2371935965
@ChristianJohnston97 what about your custom tool?
I have the same problem, for me sometimes it works with
## Tool Input:
{\"query\": \"my query\"}
but most of the time I get something like
## Tool Input:
"{\"name\": \"my query\", \"description\": \"\", \"args_schema\": {}, \"return_direct\": false, \"verbose\": false}"
resulting in
## Tool Output:
Error: the Action Input is not a valid key, value dictionary.
using gpt-4o-mini and tried @tool
and using the base class
same issue with 0.76.2. In fact, just running "crewai create crew" and then uncommenting the Custom Tool in the template, I get this error.
I have the same error and this is very impredictable.
For the same custom tool, one iteration it works, next one it fails.
when ## Tool Input: "{\"query\": {\"description\": >> It fails ...... and I get the message Input should be a valid string
but sometimes, without changing anything , description disappears and it works!
"{\"query\": \" Expected prompt.... > and it works.
crewai-tools = "==0.13.4" crewai = "==0.76.9"
i have the same issue with build-in FileWriteTool. crewai version: 0.63.2 crewai-tools 0.12.1 Python 3.12.6 langchain 0.2.16 Windows 11
# Agent: Thinker ## Thought: Thought: I need to write content to a specified TXT file to meet the given criteria. ## Using tool: File Writer Tool ## Tool Input: "{\"filename\": \"important_document.txt\", \"content\": \"This is the content of the important document that must be written to the file.\", \"overwrite\": true}" ## Tool Output: Error: the Action Input is not a valid key, value dictionary.
i think that #1344 is connected with the issue
it worked! crewai version: 0.79.4 crewai tools version: 0.14.0
I have a custom tool using the langchain StructuredTool.from_function
where DraftInput is a Pydantic class (fields excluded)
but when the tool is called, it passes in the correct JSON but inside a markdown string like so:
and so the tool fails with the error
Task output: Error: the Action Input is not a valid key, value dictionary.
How can I force it to just input the JSON object and not inside the markdown string.
langchain~=0.2.6
crewai==0.36.0