-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(anthropic): support text editor tool #9540
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
base: cb/anthropic-tool-search
Are you sure you want to change the base?
feat(anthropic): support text editor tool #9540
Conversation
🦋 Changeset detectedLatest commit: fc7209f The changes in this PR will be included in the next version bump. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
55672a2 to
d7660b3
Compare
ca7dfe1 to
0b88619
Compare
f79d2db to
da0232e
Compare
0b88619 to
c4353a9
Compare
da0232e to
5666694
Compare
c4353a9 to
0ca6c24
Compare
| }); | ||
|
|
||
| const textEditor = tools.textEditor_20250728({ | ||
| execute: async (args: TextEditor20250728Command) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wont this args type be inferred?
| execute: async (args: TextEditor20250728Command) => { | |
| async execute(args) { |
This PR adds support for Anthropic's Text Editor tool to
@langchain/anthropic, enabling Claude to view and modify text files directly. This allows Claude to debug, fix, and improve code or other text documents with hands-on assistance.Changes
New
textEditor_20250728function - For Claude 4.x models (str_replace_based_edit_tool)view,str_replace,create,insertmaxCharactersparameter for truncating large filesNew
textEditor_20250124function - For Claude 3.7 models (str_replace_editor)view,str_replace,create,insert,undo_editundo_editcommand (not available in Claude 4.x)Added strongly-typed command interfaces in
types.ts:TextEditor20250728Commandunion type withViewCommand,StrReplaceCommand,CreateCommand,InsertCommandTextEditor20250124Commandunion type (includesUndoEditCommand)Fixed provider tool definition handling in
chat_models.tsto usetool.extrasinstead oftool.metadataUpdated TypeScript target to ES2022 for better language feature support
Usage