[1/2] fix: document the name and description returned for each generation model - #141
Merged
Merged
Conversation
|
🎉 This PR is included in version 1.18.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
GET /modelsandGET /models/{id}already return anameanddescriptionfor each model, butGenerationModeldoesn't declare them. The generated zod schema is strict, so the published package rejects every real response from these endpoints.This declares both as optional strings, with examples taken from the live catalogue.
Verify:
pnpm buildandpnpm testpass on Node 22. Live/models,/models?expand=optionsand/models/{id}responses failgenerationmodelGenerationModelSchemain 1.18.3 onnameanddescription, and parse with this branch.Stack
nameanddescriptionavailableandunavailableReasonMerge bottom-up: #141 into
main, then retarget #142 tomain.flowchart LR A["Client lists generation models<br/>with its API key"] --> B{"Account's plan includes<br/>this kind of generation?"} B -- yes --> C["available: true"] B -- no --> D["available: false<br/>+ unavailableReason"] B -- "can't confirm" --> E["available omitted"] C --> F["Offer the model"] D --> G["Hide or disable the model"] E --> H["Treat as unknown;<br/>generation is still checked"]Rules:
availableandunavailableReason, list endpoint guidance.