CrewAI FileWriterTool
Hi :) I'm a bit of a noob. I couldn't find the right way to implement the tool for writing the results to a file. I think it's a matter of understanding how to use the tools.
I tried a few ways. This is my current code (it runs, but obviously doesn't save anything). It's just that when I try to pass arguments into the ._run() it tells me that I'm passing too many parameters 🤷🏻‍♂️
Any help would be very much appreciated 🙏
```
from crewai_tools import FileWriterTool
from langchain.tools import tool
class SaveTextTool():
@tool("Save the result to a text file.")
def save_to_text(context):
"""" Use this tool to save the result of a run to a text file.
The file_name_to_save is the name of the file to save the result to.
The result_to_save is the result to save to the text file.
"""
file_writer = FileWriterTool()
file_writer._run()
return "Result saved to text file."
```
2
3 comments
Michael Birkeland
3
CrewAI FileWriterTool
AI Developer Accelerator
skool.com/ai-developer-accelerator
Master AI & software development to build apps and unlock new income streams. Transform ideas into profits. 💡➕🤖➕👨‍💻🟰💰
Leaderboard (30-day)
Powered by