fix(client): make from tether import TetherClient work + ReflexClient alias#225
Open
rylinjames wants to merge 1 commit into
Open
fix(client): make from tether import TetherClient work + ReflexClient alias#225rylinjames wants to merge 1 commit into
from tether import TetherClient work + ReflexClient alias#225rylinjames wants to merge 1 commit into
Conversation
…nt alias Audit §3.9 (client SDK H1/H2/L1/L6): - H2: `from tether import TetherClient` was promised by the pyproject comment and the reflex shim docstring but raised AttributeError — the top-level __getattr__ only lazy-loaded the validate/fixtures surface. Re-export the full client SDK (TetherClient, TetherAsyncClient, the 5 exception types, encode_image) lazily from tether.client; httpx is a base dep so no torch cost. Added to __all__. - H1: add ReflexClient / ReflexAsyncClient deprecation-alias subclasses in tether.client so pre-rename code keeps importing through the v0.13.x compat window (warns once, removed v0.14.0 — matches the `reflex` import-shim schedule). The README snippets were already fixed to TetherClient in the rename-sweep PR; this covers users with the old name in their own code. - L6: encode_image() reported "Pillow required" for genuinely-unsupported types (dict, int, …) when Pillow was absent, blaming a missing optional dep on a caller who passed garbage. Now rejects non-image-like types with "unsupported image type" BEFORE requiring Pillow; real ndarray/PIL inputs still get the Pillow-required message. Fixes the previously-failing test_encode_unsupported_type_raises. - L1: removed dead `last_exc` assignments in the sync retry loop; removed an unused `glob` import in __init__. Verified: tests/test_client.py 29 passed / 2 skipped; top-level + alias import behavior unit-checked; ruff clean on all touched files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the SDK side of the v0.12.0 rename (audit §3.9, client H1/H2 + L1/L6).
Changes
from tether import TetherClientnow works__getattr__only exposed the validate/fixtures surface →AttributeError. Now re-exports the full SDK lazily fromtether.client(httpx is a base dep, so no torch cost).ReflexClient/ReflexAsyncClientdeprecation aliasesfrom tether.client import ReflexClientkeeps working through v0.13.x (warns once, removed v0.14.0 — matches therefleximport-shim schedule). README snippets were already fixed toTetherClientin #224; this covers users with the old name in their own code.encode_imageerror accuracylast_exc(sync retry loop) and an unusedglobimport.Verification
tests/test_client.py: 29 passed, 2 skipped (the previously-failingtest_encode_unsupported_type_raisesnow passes — it was asserting the L6 behavior).tether.TetherClient is TetherClient+ alias DeprecationWarning unit-checked.ruff checkclean on all touched files.Not included (needs a customer-facing API decision, flagged separately): client M5 — capping a server-supplied
Retry-Afterwould add a new constructor kwarg.🤖 Generated with Claude Code