effect-io-ai

Package: @effect/ai-anthropic
Module: AnthropicTool

AnthropicTool.TextEditor_20250124

Defines the text editor tool for deprecated Claude Sonnet 3.7.

When to use

Use when you need the 2025-01-24 Claude Sonnet 3.7 text editor tool using str_replace_editor.

Details

Requires the “computer-use-2025-01-24” beta header, requires a handler, and supports view, create, str_replace, insert, and undo_edit commands.

See

Signature

declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: { readonly failureMode?: Mode | undefined; }) => Tool.ProviderDefined<"anthropic.text_editor_20250124", "AnthropicTextEditor", { readonly args: Schema.Void; readonly parameters: Schema.Union<readonly [Schema.Struct<{ readonly command: Schema.Literal<"view">; readonly path: Schema.String; readonly view_range: Schema.optionalKey<Schema.Tuple<readonly [Schema.Int, Schema.Int]>>; }>, Schema.Struct<{ readonly command: Schema.Literal<"create">; readonly path: Schema.String; readonly file_text: Schema.String; }>, Schema.Struct<{ readonly command: Schema.Literal<"str_replace">; readonly path: Schema.String; readonly old_str: Schema.String; readonly new_str: Schema.String; }>, Schema.Struct<{ readonly command: Schema.Literal<"insert">; readonly path: Schema.String; readonly insert_line: Schema.Int; readonly new_str: Schema.String; }>, Schema.Struct<{ readonly command: Schema.Literal<"undo_edit">; readonly path: Schema.String; }>]>; readonly success: Schema.String; readonly failure: Schema.Never; readonly failureMode: Mode extends undefined ? "error" : Mode; }, true>

Source

Since v4.0.0