We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 576bc0c commit 30324ceCopy full SHA for 30324ce
1 file changed
tests/test_issue_587.py
@@ -0,0 +1,18 @@
1
+"""Regression test for issue #587 -- ImageOutput.save() with data URLs."""
2
+
3
+import base64
4
5
+from agentfield.multimodal_response import ImageOutput
6
7
8
+def test_issue_587(tmp_path):
9
+ """Gemini-style data URLs should save locally without an HTTP request."""
10
+ image_bytes = b"\x89PNG\r\n\x1a\nissue-587"
11
+ image = ImageOutput(
12
+ url=f"data:image/png;base64,{base64.b64encode(image_bytes).decode()}"
13
+ )
14
+ output_path = tmp_path / "gemini-image.png"
15
16
+ image.save(output_path)
17
18
+ assert output_path.read_bytes() == image_bytes
0 commit comments