Skip to content

Commit 41fc752

Browse files
committed
Fixed bug where openAI model was hardcoded and not being red from settings pages
1 parent f84a4e6 commit 41fc752

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

extensions/chatbot/chatbot.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ async function callOpenAI (string_array, modelToUse, platform)
20432043
});
20442044

20452045
const response = await localConfig.OpenAPIHandle.responses.create({
2046-
model: "gpt-4.1",
2046+
model: modelToUse.model,
20472047
store: false,
20482048
max_output_tokens: Number(modelToUse.max_tokens),
20492049
temperature: Number(modelToUse.chattemperature),
@@ -2145,9 +2145,8 @@ async function callOpenAI (string_array, modelToUse, platform)
21452145
*/
21462146
function addPersonality (username, message, profile, platform)
21472147
{
2148-
let outputmessage = [{ "role": "system", "content": serverConfig.chatbotprofiles[profile].p }]
2149-
2150-
let CBBehaviour = [
2148+
let outputmessage = [
2149+
{ "role": "system", "content": serverConfig.chatbotprofiles[profile].p },
21512150
{ "role": "user", "content": serverConfig.chatbotprofiles[profile].q1.replace("%%CHATBOTTRIGGERNAME%%", serverConfig.chatbotnametriggertag) },
21522151
{ "role": "assistant", "content": serverConfig.chatbotprofiles[profile].a1 },
21532152
{ "role": "user", "content": serverConfig.chatbotprofiles[profile].q2.replace("%%CHATBOTTRIGGERNAME%%", serverConfig.chatbotnametriggertag) },
@@ -2157,9 +2156,6 @@ function addPersonality (username, message, profile, platform)
21572156
{ "role": "user", "content": serverConfig.chatbotprofiles[profile].q4.replace("%%CHATBOTTRIGGERNAME%%", serverConfig.chatbotnametriggertag) },
21582157
{ "role": "assistant", "content": serverConfig.chatbotprofiles[profile].a4 }
21592158
];
2160-
// add behaviour messages
2161-
for (const obj of CBBehaviour)
2162-
outputmessage.push(obj);
21632159

21642160
if (message == "")
21652161
{

0 commit comments

Comments
 (0)