File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ export class ChatGPTApi implements LLMApi {
200200 options . config . model . startsWith ( "o1" ) ||
201201 options . config . model . startsWith ( "o3" ) ||
202202 options . config . model . startsWith ( "o4-mini" ) ;
203+ const isGpt5 = options . config . model . startsWith ( "gpt-5" ) ;
203204 if ( isDalle3 ) {
204205 const prompt = getMessageTextContent (
205206 options . messages . slice ( - 1 ) ?. pop ( ) as any ,
@@ -251,6 +252,10 @@ export class ChatGPTApi implements LLMApi {
251252 requestPayload [ "max_completion_tokens" ] = modelConfig . max_tokens ;
252253 }
253254
255+ if ( isGpt5 ) {
256+ requestPayload [ "max_completion_tokens" ] = modelConfig . max_tokens ;
257+ }
258+
254259 // add max_tokens to vision model
255260 if ( visionModel && ! isO1OrO3 ) {
256261 requestPayload [ "max_tokens" ] = Math . max ( modelConfig . max_tokens , 4000 ) ;
You can’t perform that action at this time.
0 commit comments