From 4bfae3568cb82cbf5e531cec7ddd89bdcda658dc Mon Sep 17 00:00:00 2001 From: Abacus <285829280+abacus-together@users.noreply.github.com> Date: Thu, 6 Aug 2026 06:55:18 +0000 Subject: [PATCH 1/3] feat: add py.typed marker so mypy uses the shipped type hints (#234) --- src/together/py.typed | 1 + tests/unit/test_py_typed.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/together/py.typed create mode 100644 tests/unit/test_py_typed.py diff --git a/src/together/py.typed b/src/together/py.typed new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/together/py.typed @@ -0,0 +1 @@ + diff --git a/tests/unit/test_py_typed.py b/tests/unit/test_py_typed.py new file mode 100644 index 00000000..ee85ebb3 --- /dev/null +++ b/tests/unit/test_py_typed.py @@ -0,0 +1,14 @@ +from pathlib import Path + +import together + + +def test_py_typed_marker_ships_with_package() -> None: + """PEP 561 requires the marker to sit inside the installed package. + + Checking it relative to the imported module (rather than the repo tree) + means this also fails if the marker is ever dropped from the built + distribution. + """ + package_root = Path(together.__file__).parent + assert (package_root / "py.typed").is_file() From d088e1d9b3aa3c3a3e172f36d3c278dfc2c20433 Mon Sep 17 00:00:00 2001 From: Abacus <285829280+abacus-together@users.noreply.github.com> Date: Thu, 6 Aug 2026 06:58:19 +0000 Subject: [PATCH 2/3] fix: make py.typed a zero-byte marker to satisfy end-of-file-fixer --- src/together/py.typed | 1 - 1 file changed, 1 deletion(-) diff --git a/src/together/py.typed b/src/together/py.typed index 8b137891..e69de29b 100644 --- a/src/together/py.typed +++ b/src/together/py.typed @@ -1 +0,0 @@ - From f7e2cbf1d3cfe8fb854f0a9aa8e03aea35eb1566 Mon Sep 17 00:00:00 2001 From: Abacus <285829280+abacus-together@users.noreply.github.com> Date: Thu, 6 Aug 2026 07:24:38 +0000 Subject: [PATCH 3/3] docs: note that the package ships type information (py.typed) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index f96bc4f9..d1a33787 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,16 @@ To install Together Python Library from PyPI, simply run: pip install together ``` +### Type hints + +This package ships inline type annotations and a [PEP 561](https://peps.python.org/pep-0561/) `py.typed` marker, so type checkers such as mypy and pyright use them automatically — no separate stub package and no `follow_untyped_imports` override needed: + +```python +from together import Together + +client = Together() # fully typed +``` + ### Setting up API Key > 🚧 You will need to create an account with [Together.ai](https://api.together.xyz/) to obtain a Together API Key.