chore: replace replace_in_file references with str_replace (#2811)

This commit is contained in:
yetone
2025-10-31 02:08:53 +08:00
committed by GitHub
parent c8bf0205b5
commit 159b452426
5 changed files with 16 additions and 17 deletions

View File

@@ -1691,7 +1691,7 @@ end
---@param tool_use AvanteLLMToolUse
function M.is_edit_tool_use(tool_use)
return tool_use.name == "replace_in_file"
return tool_use.name == "str_replace"
or tool_use.name == "edit_file"
or (tool_use.name == "str_replace_editor" and tool_use.input.command == "str_replace")
or (tool_use.name == "str_replace_based_edit_tool" and tool_use.input.command == "str_replace")

View File

@@ -126,7 +126,7 @@ Parameters:
## Example 3: Requesting to make targeted edits to a file
<tool_use>{"name": "replace_in_file", "input": {"path": "src/components/App.tsx", "the_diff": "------- SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n+++++++ REPLACE\n\n------- SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n+++++++ REPLACE\n\n------- SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n+++++++ REPLACE\n"}}</tool_use>
<tool_use>{"name": "str_replace", "input": {"path": "src/components/App.tsx", "old_str": "import React from 'react';", "new_str": "import React, { useState } from 'react';"}}</tool_use>
]]
end