@@ -12,16 +12,20 @@ describe("getModelParams", () => {
1212 }
1313
1414 const result = getModelParams ( {
15- options : { } ,
15+ format : "openai" ,
16+ settings : { } ,
1617 model,
1718 defaultMaxTokens : 1000 ,
1819 defaultTemperature : 0.5 ,
1920 } )
2021
2122 expect ( result ) . toEqual ( {
23+ format : "openai" ,
2224 maxTokens : 1000 ,
23- thinking : undefined ,
2425 temperature : 0.5 ,
26+ reasoningEffort : undefined ,
27+ reasoningBudget : undefined ,
28+ reasoning : undefined ,
2529 } )
2630 } )
2731
@@ -32,16 +36,20 @@ describe("getModelParams", () => {
3236 }
3337
3438 const result = getModelParams ( {
35- options : { modelTemperature : 0.7 } ,
39+ format : "openai" ,
40+ settings : { modelTemperature : 0.7 } ,
3641 model,
3742 defaultMaxTokens : 1000 ,
3843 defaultTemperature : 0.5 ,
3944 } )
4045
4146 expect ( result ) . toEqual ( {
47+ format : "openai" ,
4248 maxTokens : 1000 ,
43- thinking : undefined ,
4449 temperature : 0.7 ,
50+ reasoningEffort : undefined ,
51+ reasoningBudget : undefined ,
52+ reasoning : undefined ,
4553 } )
4654 } )
4755
@@ -52,10 +60,13 @@ describe("getModelParams", () => {
5260 supportsPromptCache : true ,
5361 }
5462
55- expect ( getModelParams ( { options : { } , model, defaultMaxTokens : 1000 } ) ) . toEqual ( {
63+ expect ( getModelParams ( { format : "openai" , settings : { } , model, defaultMaxTokens : 1000 } ) ) . toEqual ( {
64+ format : "openai" ,
5665 maxTokens : 2000 ,
57- thinking : undefined ,
5866 temperature : 0 ,
67+ reasoningEffort : undefined ,
68+ reasoningBudget : undefined ,
69+ reasoning : undefined ,
5970 } )
6071 } )
6172
@@ -67,10 +78,13 @@ describe("getModelParams", () => {
6778 supportsReasoningBudget : true ,
6879 }
6980
70- expect ( getModelParams ( { options : { } , model } ) ) . toEqual ( {
81+ expect ( getModelParams ( { format : "openai" , settings : { } , model } ) ) . toEqual ( {
82+ format : "openai" ,
7183 maxTokens : 2000 ,
72- reasoningBudget : 1600 , // 80% of 2000,
7384 temperature : 1.0 , // Thinking models require temperature 1.0.
85+ reasoningEffort : undefined ,
86+ reasoningBudget : 1600 , // 80% of 2000,
87+ reasoning : undefined ,
7488 } )
7589 } )
7690
@@ -81,10 +95,15 @@ describe("getModelParams", () => {
8195 supportsReasoningBudget : true ,
8296 }
8397
84- expect ( getModelParams ( { options : { modelMaxTokens : 3000 } , model, defaultMaxTokens : 2000 } ) ) . toEqual ( {
98+ expect (
99+ getModelParams ( { format : "openai" , settings : { modelMaxTokens : 3000 } , model, defaultMaxTokens : 2000 } ) ,
100+ ) . toEqual ( {
101+ format : "openai" ,
85102 maxTokens : 3000 ,
86- reasoningBudget : 2400 , // 80% of 3000,
87103 temperature : 1.0 ,
104+ reasoningEffort : undefined ,
105+ reasoningBudget : 2400 , // 80% of 3000,
106+ reasoning : undefined ,
88107 } )
89108 } )
90109
@@ -96,10 +115,13 @@ describe("getModelParams", () => {
96115 supportsReasoningBudget : true ,
97116 }
98117
99- expect ( getModelParams ( { options : { modelMaxThinkingTokens : 1500 } , model } ) ) . toEqual ( {
118+ expect ( getModelParams ( { format : "openai" , settings : { modelMaxThinkingTokens : 1500 } , model } ) ) . toEqual ( {
119+ format : "openai" ,
100120 maxTokens : 4000 ,
101- reasoningBudget : 1500 , // Using the custom value.
102121 temperature : 1.0 ,
122+ reasoningEffort : undefined ,
123+ reasoningBudget : 1500 , // Using the custom value.
124+ reasoning : undefined ,
103125 } )
104126 } )
105127
@@ -110,11 +132,13 @@ describe("getModelParams", () => {
110132 supportsPromptCache : true ,
111133 }
112134
113- expect ( getModelParams ( { options : { modelMaxThinkingTokens : 1500 } , model } ) ) . toEqual ( {
135+ expect ( getModelParams ( { format : "openai" , settings : { modelMaxThinkingTokens : 1500 } , model } ) ) . toEqual ( {
136+ format : "openai" ,
114137 maxTokens : 4000 ,
115- reasoningBudget : undefined , // Should remain undefined despite customMaxThinkingTokens being set.
116- reasoningEffort : undefined ,
117138 temperature : 0 , // Using default temperature.
139+ reasoningEffort : undefined ,
140+ reasoningBudget : undefined , // Should remain undefined despite customMaxThinkingTokens being set.
141+ reasoning : undefined ,
118142 } )
119143 } )
120144
@@ -126,10 +150,13 @@ describe("getModelParams", () => {
126150 supportsReasoningBudget : true ,
127151 }
128152
129- expect ( getModelParams ( { options : { modelMaxThinkingTokens : 500 } , model } ) ) . toEqual ( {
153+ expect ( getModelParams ( { format : "openai" , settings : { modelMaxThinkingTokens : 500 } , model } ) ) . toEqual ( {
154+ format : "openai" ,
130155 maxTokens : 2000 ,
131- reasoningBudget : 1024 , // Minimum is 1024
132156 temperature : 1.0 ,
157+ reasoningEffort : undefined ,
158+ reasoningBudget : 1024 , // Minimum is 1024
159+ reasoning : undefined ,
133160 } )
134161 } )
135162
@@ -141,10 +168,13 @@ describe("getModelParams", () => {
141168 supportsReasoningBudget : true ,
142169 }
143170
144- expect ( getModelParams ( { options : { modelMaxThinkingTokens : 5000 } , model } ) ) . toEqual ( {
171+ expect ( getModelParams ( { format : "openai" , settings : { modelMaxThinkingTokens : 5000 } , model } ) ) . toEqual ( {
172+ format : "openai" ,
145173 maxTokens : 4000 ,
146- reasoningBudget : 3200 , // 80% of 4000
147174 temperature : 1.0 ,
175+ reasoningEffort : undefined ,
176+ reasoningBudget : 3200 , // 80% of 4000
177+ reasoning : undefined ,
148178 } )
149179 } )
150180
@@ -155,10 +185,13 @@ describe("getModelParams", () => {
155185 supportsReasoningBudget : true ,
156186 }
157187
158- expect ( getModelParams ( { options : { } , model } ) ) . toEqual ( {
188+ expect ( getModelParams ( { format : "openai" , settings : { } , model } ) ) . toEqual ( {
189+ format : "openai" ,
159190 maxTokens : undefined ,
160191 temperature : 1.0 ,
192+ reasoningEffort : undefined ,
161193 reasoningBudget : Math . floor ( ANTHROPIC_DEFAULT_MAX_TOKENS * 0.8 ) ,
194+ reasoning : undefined ,
162195 } )
163196 } )
164197} )
0 commit comments