From 4dc730d68785daa9e18e76b6f5064c6e164f87fe Mon Sep 17 00:00:00 2001 From: Rutger Cappendijk Date: Mon, 4 Sep 2023 12:50:28 +0200 Subject: [PATCH 1/5] added test for prompt cache resetting --- tests/test_prompt_template.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_prompt_template.py b/tests/test_prompt_template.py index 52a4ba7..36d8de1 100644 --- a/tests/test_prompt_template.py +++ b/tests/test_prompt_template.py @@ -163,3 +163,12 @@ def test_to_prompt_works_with_tokens(): prompt = template.to_prompt(user_prompt=template.embed_prompt(user_prompt)) assert prompt == user_prompt + +def test_to_prompt_resets_cache(prompt_image: Image): + user_prompt = Prompt([prompt_image, Text.from_text("Cool"), prompt_image]) + + template = PromptTemplate("{{user_prompt}}") + + template.to_prompt(user_prompt=template.embed_prompt(user_prompt)) + + assert template.non_text_items == {} From ee73a1855e0c1f90584a04f783fe327172151c19 Mon Sep 17 00:00:00 2001 From: Rutger Cappendijk Date: Mon, 4 Sep 2023 13:28:48 +0200 Subject: [PATCH 2/5] added py.typed --- aleph_alpha_client/version.py | 2 +- py.typed | 0 setup.py | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 py.typed diff --git a/aleph_alpha_client/version.py b/aleph_alpha_client/version.py index a5cfdf5..f29ec04 100644 --- a/aleph_alpha_client/version.py +++ b/aleph_alpha_client/version.py @@ -1 +1 @@ -__version__ = "3.4.1" +__version__ = "3.4.2a1" diff --git a/py.typed b/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 77a526a..dc3d3fd 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,8 @@ def version(): url="https://github.com/Aleph-Alpha/aleph-alpha-client", author="Aleph Alpha", author_email="support@aleph-alpha.com", - packages=["aleph_alpha_client"], + packages=["aleph_alpha_client", "aleph_alpha_client/py.typed"], + package_data={"aleph_alpha_client": ["py.typed"]}, # urllib is used directly for retries install_requires=[ "requests >= 2.28", From c9b654eb38798e10a8275fda75975fb93964fe04 Mon Sep 17 00:00:00 2001 From: Rutger Cappendijk Date: Mon, 4 Sep 2023 13:32:48 +0200 Subject: [PATCH 3/5] moved py.typed to package directory --- py.typed => aleph_alpha_client/py.typed | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py.typed => aleph_alpha_client/py.typed (100%) diff --git a/py.typed b/aleph_alpha_client/py.typed similarity index 100% rename from py.typed rename to aleph_alpha_client/py.typed From cfe6dbd22273a1927a05ba577062920aa9cda1fc Mon Sep 17 00:00:00 2001 From: Rutger Cappendijk Date: Mon, 4 Sep 2023 13:36:31 +0200 Subject: [PATCH 4/5] removed py.typed from package export --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dc3d3fd..62e6d4e 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def version(): url="https://github.com/Aleph-Alpha/aleph-alpha-client", author="Aleph Alpha", author_email="support@aleph-alpha.com", - packages=["aleph_alpha_client", "aleph_alpha_client/py.typed"], + packages=["aleph_alpha_client"], package_data={"aleph_alpha_client": ["py.typed"]}, # urllib is used directly for retries install_requires=[ From 21373200ab9c30db3fa91bdcba6888afc87fc4e4 Mon Sep 17 00:00:00 2001 From: Rutger Cappendijk Date: Mon, 4 Sep 2023 13:40:18 +0200 Subject: [PATCH 5/5] updated changelog --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index c8214a4..40bd29d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## 3.4.2a1 + +- Alpha release for exporting type hints + ## 3.4.1 - `PromptTemplate` now resets cached non-text items after generating prompt