diff --git a/package.json b/package.json index 5b9d86202f8f..e0ed22c35080 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "@langchain/community": "^0.2.31", "@lobehub/chat-plugin-sdk": "^1.32.4", "@lobehub/chat-plugins-gateway": "^1.9.0", - "@lobehub/icons": "^1.33.3", + "@lobehub/icons": "^1.33.7", "@lobehub/tts": "^1.24.3", "@lobehub/ui": "^1.150.3", "@neondatabase/serverless": "^0.9.4", diff --git a/src/libs/agent-runtime/openai/index.ts b/src/libs/agent-runtime/openai/index.ts index 61ca33aeb03f..d4d718df4b49 100644 --- a/src/libs/agent-runtime/openai/index.ts +++ b/src/libs/agent-runtime/openai/index.ts @@ -2,8 +2,14 @@ import { ChatStreamPayload, ModelProvider, OpenAIChatMessage } from '../types'; import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory'; // TODO: 临时写法,后续要重构成 model card 展示配置 -const o1Models = new Set(['o1-preview', 'o1-mini']); -const truneO1Payload = (payload: ChatStreamPayload) => ({ +export const o1Models = new Set([ + 'o1-preview', + 'o1-preview-2024-09-12', + 'o1-mini', + 'o1-mini-2024-09-12', +]); + +export const pruneO1Payload = (payload: ChatStreamPayload) => ({ ...payload, frequency_penalty: 0, messages: payload.messages.map((message: OpenAIChatMessage) => ({ @@ -23,7 +29,7 @@ export const LobeOpenAI = LobeOpenAICompatibleFactory({ const { model } = payload; if (o1Models.has(model)) { - return truneO1Payload(payload) as any; + return pruneO1Payload(payload) as any; } return { ...payload, stream: payload.stream ?? true };