Sync v1 REST client with API spec - #99
Merged
Merged
Conversation
GET /v1/models gained a required `manufacturer` field on each model (ellipsis-dev/ellipsis#6106). Mirror it as a string union so an unrecognized vendor is a type error rather than a silent mislabel. Also fills in `rate_card`, which the endpoint has served all along but this client never declared. Co-Authored-By: Claude <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.
Syncs the hand-maintained v1 client with the spec after ellipsis-dev/ellipsis#6106, which added
manufacturerto theGET /v1/modelsresponse.Changed
src/lib/types.tsonly — no endpoint was added, removed, or re-pathed, sosrc/lib/api.tsneeded no change.SupportedModelmanufacturer: ModelManufacturer(required) — new onSupportedModelApiinmodels_router.py. Required in the spec, so required here.rate_card: ModelRateCard— see note below.ModelManufacturer(new) —'anthropic' | 'openai' | 'zai', mirroring theModelManufacturerStrEnum. A string union rather than an enum, matching howpackages/sharedmirrors it and howSessionSearchScope/AnalyticsAccountTypeare already declared in this file. The enum serializes to its lowercase values on the wire.ModelRateCard(new) — the five pricing lanes fromModelRateCardApi.Note:
rate_cardwas pre-existing driftrate_cardis not from #6106 — the endpoint has served it since the rate table shipped, but this client never declared it. Since the spec is the source of truth and the field sits on the same response model, it's corrected here. Flagging it separately so review isn't misled into attributing it to the trigger PR.Out of scope
ModelSpec.manufacturerand the derivedMODEL_MANUFACTURERSmap are internal registry structures, not exposed on any/v1route — nothing to mirror.src/lib/ws.tsis untouched.Verification
bun run typecheck— cleanbun run test— 426 passed (23 files)Triggered by ellipsis-dev/ellipsis#6106.