Skip to content

Commit 19d6f2d

Browse files
authored
Merge pull request #18 from workflowai/guillaume/image-file
Use File instead of Image
2 parents d852b06 + 2db1aa9 commit 19d6f2d

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ lint:
2727
.PHONY: test
2828
test:
2929
pytest
30+
31+
.PHONY: lock
32+
lock:
33+
poetry lock --no-update

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "workflowai"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
description = ""
55
authors = ["Guillaume Aquilina <[email protected]>"]
66
readme = "README.md"

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)