From cf318123972bddef6ffd3eeb48ca9de1164bbe0a Mon Sep 17 00:00:00 2001 From: "Steven B." <4163156+appatalks@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:46:28 -0600 Subject: [PATCH] o1-preview and o1-mini support added, exclude developer --- core/js/gpt-core.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/js/gpt-core.js b/core/js/gpt-core.js index c86a7b6..df61c3e 100644 --- a/core/js/gpt-core.js +++ b/core/js/gpt-core.js @@ -298,6 +298,13 @@ function trboSend() { var cStoredMessages = localStorage.getItem("messages"); kMessages = cStoredMessages ? JSON.parse(cStoredMessages) : []; + // Exclude messages with the "developer" role see + // https://github.com/appatalks/chatgpt-html/issues/63#issuecomment-2492821202 + if (sModel === 'o1-preview' || sModel === 'o1-mini') { + kMessages = kMessages.filter(msg => msg.role === 'user' || msg.role === 'assistant'); + dTemperature = 1; + } + // API Payload var data = { model: sModel,