Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add textEditor tool that combines readFile and updateFile functionality #61

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 3, 2025

This PR implements GitHub Issue #59 by creating a new textEditor tool that combines the functionality of readFile and updateFile into a single tool, similar to Anthropic's built-in text editor tool. The new tool provides the following commands:

  • view: Display file content with line numbers or directory listing
  • create: Create a new file with specified content
  • str_replace: Replace specific text in a file (must be unique)
  • insert: Insert text at a specific line number
  • undo_edit: Revert the last edit made to a file

The tool maintains state across calls, allowing for undo functionality. All tests pass and the tool is fully integrated into the agent.

@bhouston bhouston merged commit 4f054ce into main Mar 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant