How use the 'Write File' node? #2605
Replies: 5 comments 1 reply
-
I would also love more info. |
Beta Was this translation helpful? Give feedback.
-
One more that would like to know how to use the Write File and Read File tools. It's pretty concerning that the documentation has been blank for a year on such a simple and commonly used feature. |
Beta Was this translation helpful? Give feedback.
-
Hey @HenryHengZJ any idea how? Looks like we all are interested. And from what I see, the documents are not finished and I have not found a single tutorial on the internet either |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@akordowski did you make it work? I added this to the end of my system prompt Use the Write File tool to save the response in .md file, with a suitable filename .md is probably just the file type I needed, you can always use whatever file type. Then add the tool with the ![]() However I ran into error initially, because it was trying to save it to I further updated the // packages/components/nodes/tools/WriteFile:82
import * as path from 'path'
async _call({ file_path, text }: z.infer<typeof this.schema>) {
const nodeStore = this.store as NodeFileStore
// Extract just the filename from the path and clean it
let cleanFileName = path.basename(file_path)
await this.store.writeFile(cleanFileName, text)
return 'File written to successfully updated.'
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As I could not find any documentation, can any one provide an example how to use the 'Write File' node to write a file? How do I pass content to the file? Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions