Skip to content

Commit 672b2dc

Browse files
committed
feat: update Image field to match File
1 parent d852b06 commit 672b2dc

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

workflowai/core/fields/image.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
from pydantic import BaseModel, Field
1+
from workflowai.core.fields.file import File
22

33

4-
class Image(BaseModel):
5-
name: str = Field(..., description="An optional name for the image")
6-
content_type: str = Field(..., description="The content type of the image", examples=["image/png", "image/jpeg"])
7-
data: str = Field(..., description="The base64 encoded data of the image")
8-
9-
def to_url(self) -> str:
10-
return f"data:{self.content_type};base64,{self.data}"
4+
class Image(File):
5+
pass

0 commit comments

Comments
 (0)