🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
:bug: fix: request to gpt5 series should not with `top_p`, temperature when reasoning effort is not none (#10800)
Rylan Caib4ad47054aca
diff --git a/packages/model-runtime/src/core/contextBuilders/openai.ts b/packages/model-runtime/src/core/contextBuilders/openai.tsindex 4774ee719c5..1a8b53b0e95 100644--- a/packages/model-runtime/src/core/contextBuilders/openai.ts+++ b/packages/model-runtime/src/core/contextBuilders/openai.ts@@ -156,8 +156,14 @@ export const pruneReasoningPayload = (payload: ChatStreamPayload) => {stream: shouldStream,// Only include stream_options when stream is enabled...(shouldStream && stream_options && { stream_options }),- temperature: isEffortNone ? payload.temperature : 1,- top_p: isEffortNone ? payload.top_p : 1,++ /**+ * In openai docs: https://platform.openai.com/docs/guides/latest-model#gpt-5-2-parameter-compatibility+ * Fields like `top_p`, `temperature` and `logprobs` only supported to+ * GPT-5 series (e.g. 5-mini 5-nano ) when reasoning effort is none+ */+ temperature: isEffortNone ? payload.temperature : undefined,+ top_p: isEffortNone ? payload.top_p : undefined,};};diff --git a/packages/model-runtime/src/providers/github/index.test.ts b/packages/model-runtime/src/providers/github/index.test.tsindex eb63c7bcc8f..daf495607ee 100644--- a/packages/model-runtime/src/providers/github/index.test.ts+++ b/packages/model-runtime/src/providers/github/index.test.ts@@ -86,8 +86,8 @@ describe('LobeGithubAI - custom features', () => {expect(result.model).toBe('o1-preview');expect(result.stream).toBe(false);- expect(result.temperature).toBe(1);- expect(result.top_p).toBe(1);+ expect(result.temperature).toBe(undefined);+ expect(result.top_p).toBe(undefined);expect(result.frequency_penalty).toBe(0);expect(result.presence_penalty).toBe(0);});@@ -117,8 +117,8 @@ describe('LobeGithubAI - custom features', () => {expect(result.model).toBe('o3-preview');expect(result.stream).toBe(false);- expect(result.temperature).toBe(1);- expect(result.top_p).toBe(1);+ expect(result.temperature).toBe(undefined);+ expect(result.top_p).toBe(undefined);});it('should handle o3-mini models', () => {