[pull] main from lobehub:main#416
Merged
Merged
Conversation
…9041) * ✨ feat: add NewAPI as a router provider for multi-model aggregation * Update packages/model-runtime/src/newapi/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/model-runtime/src/newapi/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/model-runtime/src/newapi/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/model-runtime/src/newapi/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 🐛 fix: correct baseURL configuration and add comprehensive tests for NewAPI - Fix baseURL handling to avoid double /v1 path - Add url-join for proper URL concatenation - Simplify router models functions using Array.from and filter - Add comprehensive test coverage with 100% branch coverage - Fix TypeScript type issues in tests * 🧪 test: implement 100% branch coverage for NewAPI runtime - Add comprehensive test suite with 44 test cases - Achieve 100% branch coverage for all conditional logic - Test all provider detection, pricing calculation, and data handling branches - Fix TypeScript type errors with proper type annotations - Maintain all 44 tests passing with zero errors - Cover handlePayload, getProviderFromOwnedBy, and models function branches - No business code modifications - test-only changes * 🔨 fix: adjust for review comment #9041 (review) * 🐛 fix: resolve NewAPI baseURL transmission issue with dynamic routers configuration - Extend RouterRuntime to support dynamic routers: RouterInstance[] | ((options) => RouterInstance[]) - Refactor NewAPI from IIFE closure to dynamic configuration function - Fix timing issue where routers were configured before baseURL was available - Add comprehensive tests for dynamic routers functionality - Resolve 'Invalid URL input: v1/models' error by ensuring user baseURL propagates correctly - Maintain backward compatibility with static routers arrays Tests: NewAPI (44→45), RouterRuntime (15→17), all passing
## [Version 1.123.0](v1.122.7...v1.123.0) <sup>Released on **2025-09-04**</sup> #### ✨ Features - **misc**: Add NewAPI as a router provider for multi-model aggregation. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add NewAPI as a router provider for multi-model aggregation, closes [#9041](#9041) [/github.com//pull/9041#pullrequestreview-3183464594](https://github.com//github.com/lobehub/lobe-chat/pull/9041/issues/pullrequestreview-3183464594) ([7e291c2](7e291c2)) </details> <div align="right"> [](#readme-top) </div>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.3)
Can you help keep this open source service alive? 💖 Please sponsor : )