
Exposes a new "edit files" tool that the model can use to apply modifications to files in the project. The main model provides instructions and the tool uses a separate "editor" model (Claude 3.5 by default) to generate search/replace blocks like Aider does: ````markdown mathweb/flask/app.py ```python <<<<<<< SEARCH from flask import Flask ======= import math from flask import Flask >>>>>>> REPLACE ``` ```` The search/replace blocks are parsed and applied as they stream in. If a block fails to parse, the tool will apply the other edits and report an error pointing to the part of the input where it occurred. This should allow the model to fix it. Release Notes: - N/A --------- Co-authored-by: Antonio Scandurra <me@as-cii.com>
22 lines
572 B
Rust
22 lines
572 B
Rust
mod edit_files_tool;
|
|
mod list_worktrees_tool;
|
|
mod now_tool;
|
|
mod read_file_tool;
|
|
|
|
use assistant_tool::ToolRegistry;
|
|
use gpui::App;
|
|
|
|
use crate::edit_files_tool::EditFilesTool;
|
|
use crate::list_worktrees_tool::ListWorktreesTool;
|
|
use crate::now_tool::NowTool;
|
|
use crate::read_file_tool::ReadFileTool;
|
|
|
|
pub fn init(cx: &mut App) {
|
|
assistant_tool::init(cx);
|
|
|
|
let registry = ToolRegistry::global(cx);
|
|
registry.register_tool(NowTool);
|
|
registry.register_tool(ListWorktreesTool);
|
|
registry.register_tool(ReadFileTool);
|
|
registry.register_tool(EditFilesTool);
|
|
}
|