mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-13 21:42:52 -05:00
fix: Improve edit file tool description
This commit is contained in:
@ -56,6 +56,7 @@ QString EditFileTool::description() const
|
|||||||
"and new_content to replace it with. Changes are applied immediately if auto-apply "
|
"and new_content to replace it with. Changes are applied immediately if auto-apply "
|
||||||
"is enabled in settings. The user can undo or reapply changes at any time. "
|
"is enabled in settings. The user can undo or reapply changes at any time. "
|
||||||
"\n\nIMPORTANT:"
|
"\n\nIMPORTANT:"
|
||||||
|
"\n- ALWAYS read the current file content before editing to ensure accuracy."
|
||||||
"\n- For EMPTY files: use empty old_content (empty string or omit parameter)."
|
"\n- For EMPTY files: use empty old_content (empty string or omit parameter)."
|
||||||
"\n- To append at the END of file: use empty old_content."
|
"\n- To append at the END of file: use empty old_content."
|
||||||
"\n- To insert at the BEGINNING of a file (e.g., copyright header), you MUST provide "
|
"\n- To insert at the BEGINNING of a file (e.g., copyright header), you MUST provide "
|
||||||
@ -63,8 +64,10 @@ QString EditFileTool::description() const
|
|||||||
"then put those lines + new header in new_content."
|
"then put those lines + new header in new_content."
|
||||||
"\n- For replacements in the middle, provide EXACT matching text with sufficient "
|
"\n- For replacements in the middle, provide EXACT matching text with sufficient "
|
||||||
"context (at least 5-10 lines) to ensure correct placement."
|
"context (at least 5-10 lines) to ensure correct placement."
|
||||||
"\n- The system requires 85% similarity for first-time edits. Provide accurate "
|
"\n- The system uses fuzzy matching with 85% similarity threshold for first-time edits. "
|
||||||
"old_content to avoid incorrect placement.";
|
"Provide accurate old_content to avoid incorrect placement."
|
||||||
|
"\n- If changes remain 'pending' and file content hasn't changed, the user likely "
|
||||||
|
"disabled auto-apply. DO NOT retry the same edit - wait for user action.";
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject EditFileTool::getDefinition(LLMCore::ToolSchemaFormat format) const
|
QJsonObject EditFileTool::getDefinition(LLMCore::ToolSchemaFormat format) const
|
||||||
@ -81,8 +84,10 @@ QJsonObject EditFileTool::getDefinition(LLMCore::ToolSchemaFormat format) const
|
|||||||
QJsonObject oldContentProperty;
|
QJsonObject oldContentProperty;
|
||||||
oldContentProperty["type"] = "string";
|
oldContentProperty["type"] = "string";
|
||||||
oldContentProperty["description"]
|
oldContentProperty["description"]
|
||||||
= "The exact content to find and replace. Must match exactly (including whitespace). "
|
= "The content to find and replace. For exact matches, provide precise text "
|
||||||
"If empty, new_content will be appended to the end of the file";
|
"(including whitespace). For changed files, the system uses fuzzy matching with "
|
||||||
|
"85% similarity threshold for first-time edits. If empty, new_content will be "
|
||||||
|
"appended to the end of the file";
|
||||||
properties["old_content"] = oldContentProperty;
|
properties["old_content"] = oldContentProperty;
|
||||||
|
|
||||||
QJsonObject newContentProperty;
|
QJsonObject newContentProperty;
|
||||||
|
|||||||
Reference in New Issue
Block a user