diff --git a/src/crewai/tools/agent_tools/edit_file_tool.py b/src/crewai/tools/agent_tools/edit_file_tool.py index 5677a0139..e413f7a39 100644 --- a/src/crewai/tools/agent_tools/edit_file_tool.py +++ b/src/crewai/tools/agent_tools/edit_file_tool.py @@ -2,7 +2,6 @@ from crewai.tools import BaseTool from crewai.llm import LLM from typing import Type, Optional from pydantic import BaseModel, Field -import os from pathlib import Path @@ -63,7 +62,7 @@ class EditFileTool(BaseTool): new_content = self._extract_file_content(response) if new_content is None: - return f"Error: Failed to generate valid file content. LLM response was malformed." + return "Error: Failed to generate valid file content. LLM response was malformed." backup_path = f"{file_path}.backup" with open(backup_path, 'w', encoding='utf-8') as f: diff --git a/tests/tools/test_edit_file_tool.py b/tests/tools/test_edit_file_tool.py index 4819cf581..f9cf931ad 100644 --- a/tests/tools/test_edit_file_tool.py +++ b/tests/tools/test_edit_file_tool.py @@ -1,7 +1,6 @@ import pytest import tempfile import os -from pathlib import Path from unittest.mock import Mock, patch from crewai.tools.agent_tools.edit_file_tool import EditFileTool, EditFileToolInput diff --git a/tests/tools/test_edit_file_tool_integration.py b/tests/tools/test_edit_file_tool_integration.py index 35070dfeb..4708f7f3b 100644 --- a/tests/tools/test_edit_file_tool_integration.py +++ b/tests/tools/test_edit_file_tool_integration.py @@ -1,4 +1,3 @@ -import pytest import tempfile import os from unittest.mock import patch