langchain
langchain copied to clipboard
Add Other File Utilities
Add other File Utilities, include
- List Directory
- Search for file
- Move
- Copy
- Remove file
Bundle as toolkit Add a notebook that connects to the Chat Agent, which somewhat supports multi-arg input tools Update original read/write files to return the original dir paths and better handle unsupported file paths. Add unit tests
Update Chat OutputParser to handle the case where the LLM outputs an action followed by a false "final answer" string - > strip the action first and run with that.
This extremely cool!! Since you have thought so much about this already, do you think it's possible to make a tool which can edit files in a given region. Something like if the agent wants to modify a function, it shouldn't be rewriting the whole file, just the method. This way we can ask agents to do more complex things without running out of context windows.
This extremely cool!! Since you have thought so much about this already, do you think it's possible to make a tool which can edit files in a given region. Something like if the agent wants to modify a function, it shouldn't be rewriting the whole file, just the method. This way we can ask agents to do more complex things without running out of context windows.
That's a great question! I've hacked something to do this but am not sure the most general way at the moment. There are a number of AST parsers and codesearch tools we could use, but it needs to be validated.
I have been looking into the AST approach. Do you think that should be a different tool? Like PythonCodeTool or something. I have some time to make this but am having trouble how to get started. Writing the functionality is simple but making a tool out of it is a bit tricky for me. Could use some guidance like how do I test this? Can't think of a minimal task.
Best thing I could find was the inspect
module, but it only allows us to get information about code, not write it.
Wouldn't grep and sed work or something? Could just abstract the use of a bash script into a tool.
Wouldn't grep and sed work or something? Could just abstract the use of a bash script into a tool.
I was thinking about this, but I think the agent should have enough data about the file in the current system to figure out where to edit. Or am I putting too much faith in the model?
Yeah grep and sed are some of the next tools to implement