diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index bff34fdf8d3..39e7c9207b1 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -182,7 +182,7 @@ export class ChatGPTApi implements LLMApi { const content = visionModel ? await preProcessImageContent(v.content) : getMessageTextContent(v); - if(!(isO1 && v.role === "system")) + if (!(isO1 && v.role === "system")) messages.push({ role: v.role, content }); } @@ -316,7 +316,11 @@ export class ChatGPTApi implements LLMApi { // make a fetch request const requestTimeoutId = setTimeout( () => controller.abort(), - isDalle3 ? REQUEST_TIMEOUT_MS * 2 : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow. + isDalle3 + ? REQUEST_TIMEOUT_MS * 2 + : isO1 + ? REQUEST_TIMEOUT_MS * 3 + : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow. O1 will think twice before response so we will give it some time to think. ); const res = await fetch(chatPath, chatPayload);