From d31455d3dfb3f8efffeadf1a304ae1523495b4ef Mon Sep 17 00:00:00 2001 From: Shroominic Date: Thu, 25 Jan 2024 12:09:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20Update=20image=20import=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/openai_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/openai_test.py b/tests/openai_test.py index 9644427..efbabed 100644 --- a/tests/openai_test.py +++ b/tests/openai_test.py @@ -37,7 +37,7 @@ def test_gpt4() -> None: def test_vision() -> None: - from PIL import Image + from funcchain import Image settings.llm = "openai/gpt-4-vision-preview" @@ -45,7 +45,7 @@ class Analysis(BaseModel): description: str = Field(description="A description of the image") objects: list[str] = Field(description="A list of objects found in the image") - def analyse(image: Image.Image) -> Analysis: + def analyse(image: Image) -> Analysis: """ Analyse the image and extract its theme, description and objects. @@ -53,7 +53,7 @@ def analyse(image: Image.Image) -> Analysis: return chain() assert isinstance( - analyse(Image.open("examples/assets/old_chinese_temple.jpg")), + analyse(Image.from_file("examples/assets/old_chinese_temple.jpg")), Analysis, )