From 01892b6ec25df4a4ad670b2a2717904bff45d1f8 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 16 Mar 2023 23:43:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=86=B2=E7=AA=81=E7=9A=84openai=20base?= =?UTF-8?q?url=20v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guoba.support.js | 2 +- utils/config.js | 2 +- utils/dalle.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/guoba.support.js b/guoba.support.js index d8fe68c..38fb8b0 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -218,7 +218,7 @@ export function supportGuoba () { { field: 'openAiBaseUrl', label: 'OpenAI API服务器地址', - bottomHelpMessage: 'OpenAI的API服务器地址。默认为https://api.openai.com', + bottomHelpMessage: 'OpenAI的API服务器地址。注意要带上/v1。默认为https://api.openai.com/v1', component: 'Input' }, { diff --git a/utils/config.js b/utils/config.js index b49d403..33db89b 100644 --- a/utils/config.js +++ b/utils/config.js @@ -61,7 +61,7 @@ const defaultConfig = { initiativeChatGroups: [], enableDraw: true, helloPrompt: '写一段话让大家来找我聊天。类似于“有人找我聊天吗?"这种风格,轻松随意一点控制在20个字以内', - version: 'v2.1.8' + version: 'v2.1.9' } const _path = process.cwd() let config = {} diff --git a/utils/dalle.js b/utils/dalle.js index 361eee5..8151673 100644 --- a/utils/dalle.js +++ b/utils/dalle.js @@ -28,7 +28,7 @@ export async function createImage (prompt, n = 1, size = '512x512') { } const configuration = new Configuration({ apiKey: Config.apiKey, - basePath: basePath + '/v1' + basePath }) const openai = new OpenAIApi(configuration) if (Config.debug) { @@ -58,7 +58,7 @@ export async function imageVariation (imageUrl, n = 1, size = '512x512') { } const configuration = new Configuration({ apiKey: Config.apiKey, - basePath: basePath + '/v1' + basePath }) const openai = new OpenAIApi(configuration) if (Config.debug) { @@ -135,7 +135,7 @@ export async function editImage (originalImage, mask = [], prompt, num = 1, size } const configuration = new Configuration({ apiKey: Config.apiKey, - basePath: basePath + '/v1' + basePath }) const openai = new OpenAIApi(configuration) if (Config.debug) {