fix: 冲突的openai baseurl v1

This commit is contained in:
ikechan8370 2023-03-16 23:43:09 +08:00
parent b35a609b63
commit 01892b6ec2
3 changed files with 5 additions and 5 deletions

View file

@ -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'
},
{

View file

@ -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 = {}

View file

@ -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) {