From 7e9e71acccd6957dcac2f9aed9d92009d1c7bd83 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Tue, 19 Nov 2024 11:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20support=20o1=20models?= =?UTF-8?q?=20using=20streaming=20(#4732)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/agent-runtime/github/index.ts | 2 +- src/libs/agent-runtime/openai/index.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/agent-runtime/github/index.ts b/src/libs/agent-runtime/github/index.ts index fd7fa6f280bc..2612bc6fe697 100644 --- a/src/libs/agent-runtime/github/index.ts +++ b/src/libs/agent-runtime/github/index.ts @@ -10,7 +10,7 @@ export const LobeGithubAI = LobeOpenAICompatibleFactory({ const { model } = payload; if (o1Models.has(model)) { - return pruneO1Payload(payload) as any; + return { ...pruneO1Payload(payload), stream: false } as any; } return { ...payload, stream: payload.stream ?? true }; diff --git a/src/libs/agent-runtime/openai/index.ts b/src/libs/agent-runtime/openai/index.ts index d4d718df4b49..9c42965cce07 100644 --- a/src/libs/agent-runtime/openai/index.ts +++ b/src/libs/agent-runtime/openai/index.ts @@ -17,7 +17,6 @@ export const pruneO1Payload = (payload: ChatStreamPayload) => ({ role: message.role === 'system' ? 'user' : message.role, })), presence_penalty: 0, - stream: false, temperature: 1, top_p: 1, });