Skip to content

Commit

Permalink
Update .pyi file to match the rust (python 0.32.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellovai committed May 31, 2024
1 parent e552976 commit 6b93786
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion engine/language_client_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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", "[email protected]"]]
Expand Down
5 changes: 2 additions & 3 deletions engine/language_client_python/python_src/baml_py/baml_py.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions integ-tests/python/app/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 6b93786

Please sign in to comment.