From 672b2dc14908a4ab7b42bc065199b5b644c79e49 Mon Sep 17 00:00:00 2001 From: Guillaume Aquilina Date: Wed, 16 Oct 2024 11:46:56 -0400 Subject: [PATCH 1/2] feat: update Image field to match File --- workflowai/core/fields/image.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/workflowai/core/fields/image.py b/workflowai/core/fields/image.py index 151660a..df21708 100644 --- a/workflowai/core/fields/image.py +++ b/workflowai/core/fields/image.py @@ -1,10 +1,5 @@ -from pydantic import BaseModel, Field +from workflowai.core.fields.file import File -class Image(BaseModel): - name: str = Field(..., description="An optional name for the image") - content_type: str = Field(..., description="The content type of the image", examples=["image/png", "image/jpeg"]) - data: str = Field(..., description="The base64 encoded data of the image") - - def to_url(self) -> str: - return f"data:{self.content_type};base64,{self.data}" +class Image(File): + pass From 2db1aa951f3ad9c28a20727aeaa451f8e77dad24 Mon Sep 17 00:00:00 2001 From: Guillaume Aquilina Date: Wed, 16 Oct 2024 11:47:48 -0400 Subject: [PATCH 2/2] chore: bump version --- Makefile | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f9b2082..8eb40a1 100644 --- a/Makefile +++ b/Makefile @@ -27,3 +27,7 @@ lint: .PHONY: test test: pytest + +.PHONY: lock +lock: + poetry lock --no-update diff --git a/pyproject.toml b/pyproject.toml index 2735097..9024caf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "workflowai" -version = "0.3.2" +version = "0.3.3" description = "" authors = ["Guillaume Aquilina "] readme = "README.md"