From 9757beb4b02ecb4b82e293901f2b056924a6713e Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Sat, 3 May 2025 03:37:11 +0200 Subject: [PATCH] comment out --- backend/agent/tools/sb_files_tool.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/agent/tools/sb_files_tool.py b/backend/agent/tools/sb_files_tool.py index b04215d1..549f6777 100644 --- a/backend/agent/tools/sb_files_tool.py +++ b/backend/agent/tools/sb_files_tool.py @@ -68,11 +68,11 @@ class SandboxFilesTool(SandboxToolsBase): return {} - def _get_preview_url(self, file_path: str) -> Optional[str]: - """Get the preview URL for a file if it's an HTML file.""" - if file_path.lower().endswith('.html') and self._sandbox_url: - return f"{self._sandbox_url}/{(file_path.replace('/workspace/', ''))}" - return None + # def _get_preview_url(self, file_path: str) -> Optional[str]: + # """Get the preview URL for a file if it's an HTML file.""" + # if file_path.lower().endswith('.html') and self._sandbox_url: + # return f"{self._sandbox_url}/{(file_path.replace('/workspace/', ''))}" + # return None @openapi_schema({ "type": "function", @@ -132,10 +132,10 @@ class SandboxFilesTool(SandboxToolsBase): self.sandbox.fs.set_file_permissions(full_path, permissions) # Get preview URL if it's an HTML file - preview_url = self._get_preview_url(file_path) + # preview_url = self._get_preview_url(file_path) message = f"File '{file_path}' created successfully." - if preview_url: - message += f"\n\nYou can preview this HTML file at the automatically served HTTP server: {preview_url}" + # if preview_url: + # message += f"\n\nYou can preview this HTML file at the automatically served HTTP server: {preview_url}" return self.success_response(message) except Exception as e: @@ -212,10 +212,10 @@ class SandboxFilesTool(SandboxToolsBase): snippet = '\n'.join(new_content.split('\n')[start_line:end_line + 1]) # Get preview URL if it's an HTML file - preview_url = self._get_preview_url(file_path) + # preview_url = self._get_preview_url(file_path) message = f"Replacement successful." - if preview_url: - message += f"\n\nYou can preview this HTML file at: {preview_url}" + # if preview_url: + # message += f"\n\nYou can preview this HTML file at: {preview_url}" return self.success_response(message) @@ -277,10 +277,10 @@ class SandboxFilesTool(SandboxToolsBase): self.sandbox.fs.set_file_permissions(full_path, permissions) # Get preview URL if it's an HTML file - preview_url = self._get_preview_url(file_path) + # preview_url = self._get_preview_url(file_path) message = f"File '{file_path}' completely rewritten successfully." - if preview_url: - message += f"\n\nYou can preview this HTML file at: {preview_url}" + # if preview_url: + # message += f"\n\nYou can preview this HTML file at: {preview_url}" return self.success_response(message) except Exception as e: