Fix image serialization for long image string (#348)

This commit is contained in:
Parth Sareen
2024-11-28 14:12:55 -08:00
committed by GitHub
parent b50a65b27d
commit d6528cf731
2 changed files with 13 additions and 2 deletions
+6
View File
@@ -19,6 +19,12 @@ def test_image_serialization_base64_string():
assert img.model_dump() == b64_str # Should return as-is if valid base64
def test_image_serialization_long_base64_string():
b64_str = 'dGVzdCBiYXNlNjQgc3RyaW5n' * 1000
img = Image(value=b64_str)
assert img.model_dump() == b64_str # Should return as-is if valid base64
def test_image_serialization_plain_string():
img = Image(value='not a path or base64')
assert img.model_dump() == 'not a path or base64' # Should return as-is