Skip to content

Commit 38fadad

Browse files
authored
Merge pull request #113 from profullstack/fix/news-summarize-temperature
fix(news): drop unsupported temperature from summarize (gpt-5.x 400)
2 parents d72e568 + c8e6e81 commit 38fadad

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/app/api/news/summarize/route.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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 () => {

src/app/api/news/summarize/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)