Skip to content

feat: add text editor tool implementation#71

Merged
ncoop57 merged 3 commits intomainfrom
text_editor
May 8, 2025
Merged

feat: add text editor tool implementation#71
ncoop57 merged 3 commits intomainfrom
text_editor

Conversation

@ncoop57
Copy link
Contributor

@ncoop57 ncoop57 commented May 1, 2025

Overview

Adds support for Anthropic's Text Editor Tool API, allowing Claude to view and edit files.

Key Changes

  • Added implementations of text editor tool functions from @austinvhuang: view, create, insert, str_replace.
  • Adds str_replace_editor dispatcher function for handling tool commands
  • Provides text_editor_conf dictionary with tool schemas for the 3.5 and 3.7 sonnet versions
  • Updates core nb to show using the text editor tool
  • Adds documentation and examples in 03_text_editor.ipynb

Resolves #69

@gitnotebooks
Copy link

gitnotebooks bot commented May 1, 2025

Found 2 changed notebooks. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/claudette/pull/71

@ncoop57 ncoop57 requested review from Copilot and jph00 May 1, 2025 18:57

This comment was marked as off-topic.

@jph00
Copy link
Contributor

jph00 commented May 1, 2025

Thanks @ncoop57 ! Are these the same implementations that are in llmcoder? If so, will llmcoder use this as a dep, to avoid dupe code?

@jph00
Copy link
Contributor

jph00 commented May 1, 2025

BTW @ncoop57 this copilot stuff is more of the annoying and unhelpful AI stuff that wastes time unless carefully reviewed -- let's not have it add to to everyone's cognitive overhead; only include AI generated outputs after you've reviewed them.

@ncoop57
Copy link
Contributor Author

ncoop57 commented May 2, 2025

@jph00 yes these are the same ones used in llmcoder and shell sage. Should remove the dup code from both of them to just use this implementation.

@jph00
Copy link
Contributor

jph00 commented May 2, 2025

@jph00 yes these are the same ones used in llmcoder and shell sage. Should remove the dup code from both of them to just use this implementation.

OK great - are you able to do those too please? Maybe check with @austinvhuang to ensure he's happy with this solution for llmcoder?

@austinvhuang
Copy link
Contributor

Looks good @ncoop57 , I will remove the implementation from llmcoder.

Separately, while not required for this PR, we'll want to consider a strs_replace https://gist.github.com/jph00/8e7a7c0c42c68406e55bffbd6841f029 (it's not in the claude text editor spec but incredibly useful to have).

@ncoop57 ncoop57 merged commit 7423936 into main May 8, 2025
@ncoop57 ncoop57 deleted the text_editor branch May 8, 2025 17:42
@ncoop57 ncoop57 added the enhancement New feature or request label May 9, 2025
@austinvhuang
Copy link
Contributor

Looks good @ncoop57 , I will remove the implementation from llmcoder.

Closing the loop on this, llmcoder has been updated with a3cebb5dcdacb82f1bee137b59e8884b6d83941d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for anthropic text editor tool

4 participants