File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
packages/types/src/providers
src/api/providers/fetchers/__tests__ Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ export const OPEN_ROUTER_PROMPT_CACHING_MODELS = new Set([
3939 "anthropic/claude-3.7-sonnet:thinking" ,
4040 "anthropic/claude-sonnet-4" ,
4141 "anthropic/claude-opus-4" ,
42- "google/gemini-2.5-pro-preview" ,
4342 "google/gemini-2.5-flash-preview" ,
4443 "google/gemini-2.5-flash-preview:thinking" ,
4544 "google/gemini-2.5-flash-preview-05-20" ,
Original file line number Diff line number Diff line change @@ -23,12 +23,22 @@ describe("OpenRouter API", () => {
2323
2424 const models = await getOpenRouterModels ( )
2525
26- expect (
27- Object . entries ( models )
28- . filter ( ( [ _ , model ] ) => model . supportsPromptCache )
29- . map ( ( [ id , _ ] ) => id )
30- . sort ( ) ,
31- ) . toEqual ( Array . from ( OPEN_ROUTER_PROMPT_CACHING_MODELS ) . sort ( ) )
26+ const openRouterSupportedCaching = Object . entries ( models )
27+ . filter ( ( [ _ , model ] ) => model . supportsPromptCache )
28+ . map ( ( [ id , _ ] ) => id )
29+
30+ const ourCachingModels = Array . from ( OPEN_ROUTER_PROMPT_CACHING_MODELS )
31+
32+ // Verify all our caching models are actually supported by OpenRouter
33+ for ( const modelId of ourCachingModels ) {
34+ expect ( openRouterSupportedCaching ) . toContain ( modelId )
35+ }
36+
37+ // Verify we have all supported models except intentionally excluded ones
38+ const excludedModels = new Set ( [ "google/gemini-2.5-pro-preview" ] ) // Excluded due to lag issue (#4487)
39+ const expectedCachingModels = openRouterSupportedCaching . filter ( ( id ) => ! excludedModels . has ( id ) ) . sort ( )
40+
41+ expect ( ourCachingModels . sort ( ) ) . toEqual ( expectedCachingModels )
3242
3343 expect (
3444 Object . entries ( models )
You can’t perform that action at this time.
0 commit comments