File tree Expand file tree Collapse file tree
src/app/api/news/summarize Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -473,12 +473,13 @@ describe('News Summarize API Route', () => {
473473 response_format : { type : 'json_object' } ,
474474 max_completion_tokens : 1500 ,
475475 reasoning_effort : 'high' ,
476- temperature : 0.3 ,
477476 } ) ,
478477 expect . objectContaining ( {
479478 timeout : 60000 ,
480479 } )
481480 ) ;
481+ // gpt-5.x reasoning models reject a custom temperature; we must not send one.
482+ expect ( mockOpenAICreate . mock . calls [ 0 ] [ 0 ] ) . not . toHaveProperty ( 'temperature' ) ;
482483 } ) ;
483484
484485 it ( 'should include article content in the prompt' , async ( ) => {
Original file line number Diff line number Diff line change @@ -195,7 +195,8 @@ ${truncatedContent}`;
195195 response_format : { type : 'json_object' } ,
196196 max_completion_tokens : 1500 ,
197197 reasoning_effort : 'high' ,
198- temperature : 0.3 ,
198+ // gpt-5.x reasoning models only support the default temperature (1);
199+ // passing a custom value returns a 400.
199200 } ,
200201 {
201202 timeout : 60000 , // 60 second timeout
You can’t perform that action at this time.
0 commit comments