mirror of
https://github.com/open-webui/open-webui
synced 2024-11-24 13:07:25 +00:00
fix: openai model support
This commit is contained in:
parent
044ee2a78c
commit
1196fa886a
@ -85,6 +85,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendPromptOllama = async (model, userPrompt, parentId) => {
|
const sendPromptOllama = async (model, userPrompt, parentId) => {
|
||||||
|
console.log('sendPromptOllama');
|
||||||
let responseMessageId = uuidv4();
|
let responseMessageId = uuidv4();
|
||||||
|
|
||||||
let responseMessage = {
|
let responseMessage = {
|
||||||
@ -214,7 +215,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendPromptOpenAI = async (model, userPrompt, parentId) => {
|
const sendPromptOpenAI = async (model, userPrompt, parentId) => {
|
||||||
if (settings.OPENAI_API_KEY) {
|
if ($settings.OPENAI_API_KEY) {
|
||||||
if (models) {
|
if (models) {
|
||||||
let responseMessageId = uuidv4();
|
let responseMessageId = uuidv4();
|
||||||
|
|
||||||
@ -242,7 +243,7 @@
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${settings.OPENAI_API_KEY}`
|
Authorization: `Bearer ${$settings.OPENAI_API_KEY}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: model,
|
model: model,
|
||||||
@ -251,7 +252,7 @@
|
|||||||
$settings.system
|
$settings.system
|
||||||
? {
|
? {
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: settings.system
|
content: $settings.system
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
...messages
|
...messages
|
||||||
|
@ -251,7 +251,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendPromptOpenAI = async (model, userPrompt, parentId) => {
|
const sendPromptOpenAI = async (model, userPrompt, parentId) => {
|
||||||
if (settings.OPENAI_API_KEY) {
|
if ($settings.OPENAI_API_KEY) {
|
||||||
if (models) {
|
if (models) {
|
||||||
let responseMessageId = uuidv4();
|
let responseMessageId = uuidv4();
|
||||||
|
|
||||||
@ -279,7 +279,7 @@
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${settings.OPENAI_API_KEY}`
|
Authorization: `Bearer ${$settings.OPENAI_API_KEY}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: model,
|
model: model,
|
||||||
@ -288,7 +288,7 @@
|
|||||||
$settings.system
|
$settings.system
|
||||||
? {
|
? {
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: settings.system
|
content: $settings.system
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
...messages
|
...messages
|
||||||
|
Loading…
Reference in New Issue
Block a user