Skip to content

Commit

Permalink
fix: give o1 some time to think twice
Browse files Browse the repository at this point in the history
  • Loading branch information
skymkmk committed Sep 13, 2024
1 parent d0dce65 commit 55cd20e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/client/platforms/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 55cd20e

Please sign in to comment.