fix: openai model support

This commit is contained in:
Timothy J. Baek 2023-11-22 13:11:26 -08:00
parent 044ee2a78c
commit 1196fa886a
2 changed files with 7 additions and 6 deletions

View File

@ -85,6 +85,7 @@
};
const sendPromptOllama = async (model, userPrompt, parentId) => {
console.log('sendPromptOllama');
let responseMessageId = uuidv4();
let responseMessage = {
@ -214,7 +215,7 @@
};
const sendPromptOpenAI = async (model, userPrompt, parentId) => {
if (settings.OPENAI_API_KEY) {
if ($settings.OPENAI_API_KEY) {
if (models) {
let responseMessageId = uuidv4();
@ -242,7 +243,7 @@
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${settings.OPENAI_API_KEY}`
Authorization: `Bearer ${$settings.OPENAI_API_KEY}`
},
body: JSON.stringify({
model: model,
@ -251,7 +252,7 @@
$settings.system
? {
role: 'system',
content: settings.system
content: $settings.system
}
: undefined,
...messages

View File

@ -251,7 +251,7 @@
};
const sendPromptOpenAI = async (model, userPrompt, parentId) => {
if (settings.OPENAI_API_KEY) {
if ($settings.OPENAI_API_KEY) {
if (models) {
let responseMessageId = uuidv4();
@ -279,7 +279,7 @@
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${settings.OPENAI_API_KEY}`
Authorization: `Bearer ${$settings.OPENAI_API_KEY}`
},
body: JSON.stringify({
model: model,
@ -288,7 +288,7 @@
$settings.system
? {
role: 'system',
content: settings.system
content: $settings.system
}
: undefined,
...messages