@@ -9,11 +9,9 @@ export namespace ModelsDev {
99 const log = Log . create ( { service : "models.dev" } )
1010 const filepath = path . join ( Global . Path . cache , "models.json" )
1111
12- const isoDate = z
13- . string ( )
14- . regex ( / ^ \d { 4 } - \d { 2 } ( - \d { 2 } ) ? $ / , {
15- message : "Must be in YYYY-MM or YYYY-MM-DD format" ,
16- } )
12+ const isoDate = z . string ( ) . regex ( / ^ \d { 4 } - \d { 2 } ( - \d { 2 } ) ? $ / , {
13+ message : "Must be in YYYY-MM or YYYY-MM-DD format" ,
14+ } )
1715
1816 export const Model = z
1917 . object ( {
@@ -52,23 +50,18 @@ export namespace ModelsDev {
5250 options : z . record ( z . string ( ) , z . any ( ) ) . optional ( ) ,
5351 provider : z . object ( { npm : z . string ( ) . optional ( ) , api : z . string ( ) . optional ( ) } ) . optional ( ) ,
5452 } )
55- . refine (
56- ( data ) => ! ( data . reasoning === false && data . cost ?. reasoning !== undefined ) ,
57- {
58- message : "Cannot set cost.reasoning when reasoning is false" ,
59- path : [ "cost" , "reasoning" ] ,
60- } ,
61- )
53+ . refine ( ( data ) => ! ( data . reasoning === false && data . cost ?. reasoning !== undefined ) , {
54+ message : "Cannot set cost.reasoning when reasoning is false" ,
55+ path : [ "cost" , "reasoning" ] ,
56+ } )
6257 . meta ( {
6358 ref : "Model" ,
6459 } )
6560 export type Model = z . infer < typeof Model >
6661
6762 export const Provider = z
6863 . object ( {
69- api : z
70- . string ( )
71- . optional ( ) ,
64+ api : z . string ( ) . optional ( ) ,
7265 name : z . string ( ) . min ( 1 , "Provider name cannot be empty" ) ,
7366 env : z . array ( z . string ( ) ) . min ( 1 , "Provider env cannot be empty" ) ,
7467 id : z . string ( ) ,
0 commit comments