Skip to content

Commit

Permalink
Merge pull request #134 from Aleph-Alpha/export-type-hints
Browse files Browse the repository at this point in the history
Export type hints
  • Loading branch information
rutgercap authored Sep 4, 2023
2 parents 865d248 + 2137320 commit 5acb42b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Empty file added aleph_alpha_client/py.typed
Empty file.
2 changes: 1 addition & 1 deletion aleph_alpha_client/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.4.1"
__version__ = "3.4.2a1"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def version():
author="Aleph Alpha",
author_email="[email protected]",
packages=["aleph_alpha_client"],
package_data={"aleph_alpha_client": ["py.typed"]},
# urllib is used directly for retries
install_requires=[
"requests >= 2.28",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_prompt_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == {}

0 comments on commit 5acb42b

Please sign in to comment.