Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/strands_tools/browser/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def browser(self, browser_input: BrowserInput) -> Dict[str, Any]:
return self.click(action)
elif isinstance(action, TypeAction):
return self.type(action)
elif isinstance(action, PressKeyAction):
return self.press_key(action)
elif isinstance(action, GetTextAction):
return self.get_text(action)
elif isinstance(action, GetHtmlAction):
Expand Down
3 changes: 2 additions & 1 deletion src/strands_tools/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def editor(
console = console_util.create()

try:
path = os.path.expanduser(path)
path = os.path.abspath(os.path.expanduser(path))

if not command:
raise ValueError("Command is required")
Expand Down Expand Up @@ -805,3 +805,4 @@ def editor(
"status": "error",
"content": [{"text": f"Error: {str(e)}"}],
}

5 changes: 3 additions & 2 deletions src/strands_tools/generate_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ def generate_image(tool: ToolUse, **kwargs: Any) -> ToolResult:
os.makedirs(output_dir)

i = 1
base_image_path = os.path.join(output_dir, f"{filename}.png")
ext = "jpg" if output_format == "jpeg" else output_format
base_image_path = os.path.join(output_dir, f"{filename}.{ext}")
image_path = base_image_path
while os.path.exists(image_path):
image_path = os.path.join(output_dir, f"{filename}_{i}.png")
image_path = os.path.join(output_dir, f"{filename}_{i}.{ext}")
i += 1

with open(image_path, "wb") as file:
Expand Down
Loading