@@ -199,13 +199,28 @@ describe("session.llm-native.request", () => {
199199 } )
200200
201201 test ( "selects native routes from existing provider packages" , ( ) => {
202- expect ( LLMNative . model ( { ...baseModel , api : { ...baseModel . api , npm : "@ai-sdk/anthropic" } } ) . route ) . toBe (
203- "anthropic-messages" ,
204- )
205- expect ( LLMNative . model ( { ...baseModel , api : { ...baseModel . api , npm : "@ai-sdk/google" } } ) . route ) . toBe ( "gemini" )
206- expect ( LLMNative . model ( { ...baseModel , api : { ...baseModel . api , npm : "@ai-sdk/openai-compatible" } } ) . route ) . toBe (
207- "openai-compatible-chat" ,
208- )
202+ expect (
203+ LLMNative . model ( { ...baseModel , api : { ...baseModel . api , url : "" , npm : "@ai-sdk/anthropic" } } ) ,
204+ ) . toMatchObject ( {
205+ route : "anthropic-messages" ,
206+ baseURL : "https://api.anthropic.com/v1" ,
207+ } )
208+ expect ( LLMNative . model ( { ...baseModel , api : { ...baseModel . api , url : "" , npm : "@ai-sdk/google" } } ) ) . toMatchObject ( {
209+ route : "gemini" ,
210+ baseURL : "https://generativelanguage.googleapis.com/v1beta" ,
211+ } )
212+ expect (
213+ LLMNative . model ( { ...baseModel , api : { ...baseModel . api , npm : "@ai-sdk/openai-compatible" } } ) ,
214+ ) . toMatchObject ( {
215+ route : "openai-compatible-chat" ,
216+ baseURL : "https://api.openai.com/v1" ,
217+ } )
218+ expect (
219+ LLMNative . model ( { ...baseModel , api : { ...baseModel . api , url : "" , npm : "@openrouter/ai-sdk-provider" } } ) ,
220+ ) . toMatchObject ( {
221+ route : "openrouter" ,
222+ baseURL : "https://openrouter.ai/api/v1" ,
223+ } )
209224 } )
210225
211226 test ( "fails fast for unsupported provider packages" , ( ) => {
0 commit comments