Skip to content

fix(rerank): mark rerank.create() as unavailable - #8

Merged
theQuert merged 1 commit into
mainfrom
claude/rerank-unavailable
Oct 7, 2026
Merged

theQuert merged 1 commit into
mainfrom
claude/rerank-unavailable

Conversation

@theQuert

@theQuert theQuert commented Oct 7, 2026

Copy link
Copy Markdown
Member

Closes #6.

The Apertis API has no POST /v1/rerank route, so client.rerank.create() always returns a 404 NotFoundError. This PR makes that visible. The resource itself stays.

  • Rerank.create and AsyncRerank.create are decorated with typing_extensions.deprecated.
    • At runtime they emit a DeprecationWarning: "client.rerank is not currently available …".
    • Type checkers and IDEs flag the call site.
    • typing-extensions>=4.7 is already the floor, and deprecated exists since 4.5.
  • The docstring and README say the endpoint is not currently available.
  • The rerank entry in the Features list and the Rerank Models list both say the models are listed but not callable yet.
  • The request/response contract tests stay, because they pin the contract for when the endpoint ships. Removing the decorator is the only change needed then.

The resource is not deleted, because deleting it would break existing imports and calls.

Proof

  • New TestRerankUnavailable tests cover sync and async. They failed before the change and pass after it.
  • The full suite passes on Python 3.13 and 3.9 (96 tests).
  • One extra run used -W error::DeprecationWarning with a mocked 404. The warning fires first and carries the expected message.
  • respx mocks only. No live calls.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uy5vXsRpMhug7v3XwTMZHv

The Apertis API does not serve POST /v1/rerank, so every call returns a 404.
Mark both create() methods with typing_extensions.deprecated, so callers get
a DeprecationWarning and type checkers flag the call, and say so in the
docstring and README. The resource and its request/response contract stay
in place for when the endpoint ships.

Closes #6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uy5vXsRpMhug7v3XwTMZHv
@theQuert
theQuert force-pushed the claude/rerank-unavailable branch from b1e9f97 to 9162e83 Compare October 7, 2026 00:20
@theQuert
theQuert merged commit c78406d into main Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant