88import { describe , test , expect } from "@jest/globals" ;
99import { KNOWN_MODELS } from "@/common/constants/knownModels" ;
1010import modelsJson from "@/common/utils/tokens/models.json" ;
11+ import { modelsExtra } from "@/common/utils/tokens/models-extra" ;
1112
1213describe ( "Known Models Integration" , ( ) => {
1314 test ( "all known models exist in models.json" , ( ) => {
@@ -16,10 +17,10 @@ describe("Known Models Integration", () => {
1617 for ( const [ key , model ] of Object . entries ( KNOWN_MODELS ) ) {
1718 const modelId = model . providerModelId ;
1819
19- // Check if model exists in models.json
20+ // Check if model exists in models.json or models-extra
2021 // xAI models are prefixed with "xai/" in models.json
2122 const lookupKey = model . provider === "xai" ? `xai/${ modelId } ` : modelId ;
22- if ( ! ( lookupKey in modelsJson ) ) {
23+ if ( ! ( lookupKey in modelsJson ) && ! ( modelId in modelsExtra ) ) {
2324 missingModels . push ( `${ key } : ${ model . provider } :${ modelId } ` ) ;
2425 }
2526 }
@@ -34,11 +35,13 @@ describe("Known Models Integration", () => {
3435 } ) ;
3536
3637 test ( "all known models have required metadata" , ( ) => {
37- for ( const [ key , model ] of Object . entries ( KNOWN_MODELS ) ) {
38+ for ( const [ , model ] of Object . entries ( KNOWN_MODELS ) ) {
3839 const modelId = model . providerModelId ;
3940 // xAI models are prefixed with "xai/" in models.json
4041 const lookupKey = model . provider === "xai" ? `xai/${ modelId } ` : modelId ;
41- const modelData = modelsJson [ lookupKey as keyof typeof modelsJson ] as Record < string , unknown > ;
42+ const modelData =
43+ ( modelsJson [ lookupKey as keyof typeof modelsJson ] as Record < string , unknown > ) ??
44+ ( modelsExtra [ modelId as keyof typeof modelsExtra ] as unknown as Record < string , unknown > ) ;
4245
4346 expect ( modelData ) . toBeDefined ( ) ;
4447 // Check that basic metadata fields exist (not all models have all fields)
0 commit comments