diff --git a/src/exo/master/api.py b/src/exo/master/api.py index 391bb0ff..b6e95ba6 100644 --- a/src/exo/master/api.py +++ b/src/exo/master/api.py @@ -566,14 +566,10 @@ class API: ) assert isinstance(chunk, ImageChunk) - # Convert image bytes to base64 - import base64 - - b64_image = base64.b64encode(chunk.data).decode("utf-8") - + # chunk.data is already base64-encoded string images.append( ImageData( - b64_json=b64_image + b64_json=chunk.data if payload.response_format == "b64_json" else None, url=None, # URL format not implemented yet diff --git a/src/exo/shared/types/chunks.py b/src/exo/shared/types/chunks.py index 51b79e65..f51cb364 100644 --- a/src/exo/shared/types/chunks.py +++ b/src/exo/shared/types/chunks.py @@ -23,7 +23,7 @@ class TokenChunk(BaseChunk): class ImageChunk(BaseChunk): - data: bytes + data: str # Base64-encoded image data finish_reason: FinishReason | None = None