Repository navigation
chore(providers): refresh provider metadata and ordering - #2318
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the model registries for embeddings, reranking, and providers by adding new models, removing deprecated ones, and enabling reasoning support for several entries. It also introduces alphabetical sorting for provider entries in the dashboard and enhances the documentation generation script to include versioning and corrected link paths. Feedback was provided to improve the robustness of the new provider sorting logic by adding a null check for the provider object to prevent potential runtime errors.
| function getProviderSortLabel<TProvider>(entry: ProviderEntry<TProvider>): string { | ||
| const provider = entry.provider as Record<string, unknown>; | ||
| const name = typeof provider.name === "string" ? provider.name : ""; | ||
| return (name || entry.providerId).toLowerCase(); | ||
| } |
There was a problem hiding this comment.
The getProviderSortLabel function should be more defensive when accessing entry.provider. Although provider definitions are expected to be objects, casting to Record<string, unknown> without a null check could lead to a runtime error if entry.provider is null or undefined.
| function getProviderSortLabel<TProvider>(entry: ProviderEntry<TProvider>): string { | |
| const provider = entry.provider as Record<string, unknown>; | |
| const name = typeof provider.name === "string" ? provider.name : ""; | |
| return (name || entry.providerId).toLowerCase(); | |
| } | |
| function getProviderSortLabel<TProvider>(entry: ProviderEntry<TProvider>): string { | |
| const provider = entry.provider as Record<string, unknown> | null; | |
| const name = (provider && typeof provider.name === "string") ? provider.name : ""; | |
| return (name || entry.providerId).toLowerCase(); | |
| } |
926ff2b
into
cheaper-inference:release/v3.8.0
|
Thank you @backryun for keeping the provider catalogs up to date! 🙏 The alphabetical sorting of provider entries in the dashboard sections is a nice quality-of-life improvement, and the docs generator fixes for frontmatter and relative links ensure regenerated docs stay consistent. Integrated into release/v3.8.0. 🚀 |
…erence#2318) Integrated into release/v3.8.0 — refreshes provider model metadata, sorts dashboard provider entries by display name, and fixes docs generator relative links.
…erence#2318) Integrated into release/v3.8.0 — refreshes provider model metadata, sorts dashboard provider entries by display name, and fixes docs generator relative links.
…erence#2318) Integrated into release/v3.8.0 — refreshes provider model metadata, sorts dashboard provider entries by display name, and fixes docs generator relative links.
Summary
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesAdditional local validation run:
node --import tsx/esm --test tests/unit/provider-models-config.test.ts tests/unit/providers-page-utils.test.tsTests Added Or Updated
no changes.
Coverage Notes
open-sse/and provider dashboard ordering undersrc/.Reviewer Notes