Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Empty file added src/together/py.typed
Empty file.
14 changes: 14 additions & 0 deletions tests/unit/test_py_typed.py
Original file line number Diff line number Diff line change
@@ -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()
Loading