Skip to content

Commit 9735516

Browse files
committed
ruff
1 parent 33f0a3f commit 9735516

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

openhands-tools/openhands/tools/file_editor/definition.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class FileEditorObservation(Observation):
8585
new_content: str | None = Field(
8686
default=None, description="The content of the file after the edit."
8787
)
88+
8889
_diff_cache: Text | None = PrivateAttr(default=None)
8990

9091
@property

openhands-tools/openhands/tools/file_editor/editor.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,17 @@ def view(
352352
mime_type = "image/webp"
353353
elif image_base64.startswith("Qk"):
354354
mime_type = "image/bmp"
355-
output_msg = f"Image file {path} read successfully. Displaying image content."
355+
output_msg = (
356+
f"Image file {path} read successfully. "
357+
"Displaying image content."
358+
)
359+
image_url = f"data:{mime_type};base64,{image_base64}"
356360
return FileEditorObservation(
357361
command="view",
358-
content=[TextContent(text=output_msg), ImageContent(image_urls=[f"data:{mime_type};base64,{image_base64}"])],
362+
content=[
363+
TextContent(text=output_msg),
364+
ImageContent(image_urls=[image_url]),
365+
],
359366
path=str(path),
360367
prev_exist=True,
361368
)

0 commit comments

Comments
 (0)