diff --git a/engine/language_client_python/pyproject.toml b/engine/language_client_python/pyproject.toml index 1197b4a43..f5325c1c6 100644 --- a/engine/language_client_python/pyproject.toml +++ b/engine/language_client_python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "baml-py" -version = "0.32.0" +version = "0.32.1" description = "BAML python bindings (pyproject.toml)" readme = "README.md" authors = [["Boundary", "contact@boundaryml.com"]] diff --git a/engine/language_client_python/python_src/baml_py/baml_py.pyi b/engine/language_client_python/python_src/baml_py/baml_py.pyi index 5a05be780..3d4cac7f5 100644 --- a/engine/language_client_python/python_src/baml_py/baml_py.pyi +++ b/engine/language_client_python/python_src/baml_py/baml_py.pyi @@ -32,9 +32,8 @@ class FunctionResultStream: async def done(self, ctx: RuntimeContextManager) -> FunctionResult: ... class BamlImagePy: - def __init__( - self, url: Optional[str] = None, base64: Optional[str] = None - ) -> None: ... + def from_url(url: str) -> BamlImagePy: ... + def from_base64(base64: str, media_type: str) -> BamlImagePy: ... @property def url(self) -> Optional[str]: ... @url.setter diff --git a/integ-tests/python/app/test_functions.py b/integ-tests/python/app/test_functions.py index 05695797d..8610ed394 100644 --- a/integ-tests/python/app/test_functions.py +++ b/integ-tests/python/app/test_functions.py @@ -93,8 +93,10 @@ async def test_should_work_for_all_outputs(): @pytest.mark.asyncio async def test_should_work_with_image(): - pass # TODO: Handle image testing when type definitions and support are available - + res = await b.TestImageInput( + img=baml_py.Image.from_url('https://upload.wikimedia.org/wikipedia/en/4/4d/Shrek_%28character%29.png') + ) + assert "green" in res.lower() @pytest.mark.asyncio async def test_works_with_retries2():