V 3.3.4
1. 新增MJ V7 模型 2. 添加MJ生图包
This commit is contained in:
@@ -3,6 +3,7 @@ let apiUrl = [
|
||||
label: 'LAI API - 香港',
|
||||
value: 'b44c6f24-59e4-4a71-b2c7-3df0c4e35e65',
|
||||
gpt_url: 'https://api.laitool.cc/v1/chat/completions',
|
||||
isPackage: false,
|
||||
mj_url: {
|
||||
imagine: 'https://api.laitool.cc/mj/submit/imagine',
|
||||
describe: 'https://api.laitool.cc/mj/submit/describe',
|
||||
@@ -18,6 +19,7 @@ let apiUrl = [
|
||||
label: 'LAI API - 美国',
|
||||
value: '2b443f53-ba12-42b3-a57c-e4df92685c73',
|
||||
gpt_url: 'https://laitool.net/v1/chat/completions',
|
||||
isPackage: false,
|
||||
mj_url: {
|
||||
imagine: 'https://laitool.net/mj/submit/imagine',
|
||||
describe: 'https://laitool.net/mj/submit/describe',
|
||||
@@ -58,7 +60,20 @@ let apiUrl = [
|
||||
mj_url: null,
|
||||
d3_url: null,
|
||||
buy_url: 'https://www.volcengine.com/product/doubao'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'MJ生图包-1',
|
||||
value: 'babe557a-bbb8-4aed-acca-70ea068c156f',
|
||||
isPackage: true,
|
||||
mj_url: {
|
||||
imagine: 'https://mjapi.bzu.cn/mj/submit/imagine',
|
||||
describe: 'https://mjapi.bzu.cn/mj/submit/describe',
|
||||
update_file: 'https://mjapi.bzu.cn/mj/submit/upload-discord-images',
|
||||
once_get_task: 'https://mjapi.bzu.cn/mj/task/${id}/fetch',
|
||||
query_url: "https://mjapi.bzu.cn/"
|
||||
},
|
||||
buy_url: 'https://rvgyir5wk1c.feishu.cn/wiki/P94OwwHuCi2qh8kADutcUuw4nUe'
|
||||
},
|
||||
]
|
||||
|
||||
/**
|
||||
@@ -71,4 +86,19 @@ function getApiMessageByID(id) {
|
||||
throw new Error('没有找到对应的MJ API的配置,请先检查配置')
|
||||
}
|
||||
}
|
||||
export { apiUrl, getApiMessageByID }
|
||||
|
||||
/**
|
||||
* 获取MJ API 可用的URL Options
|
||||
* @returns
|
||||
*/
|
||||
function GetMJUrlOptions(type: string) {
|
||||
if (type != 'api' && type != 'package') {
|
||||
throw new Error('没有找到对应的MJ API的配置,请先检查配置')
|
||||
}
|
||||
if (type == 'api') {
|
||||
return apiUrl.filter((item) => item.mj_url && item.isPackage == false)
|
||||
} else if (type == 'package') {
|
||||
return apiUrl.filter((item) => item.mj_url && item.isPackage == true)
|
||||
}
|
||||
}
|
||||
export { apiUrl, getApiMessageByID, GetMJUrlOptions }
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 生图包图片代理方式
|
||||
*/
|
||||
export let ImagePackageProxyOptions = [
|
||||
{
|
||||
label: "香港代理",
|
||||
value: "https://hk.bzu.cn",
|
||||
apiId: "babe557a-bbb8-4aed-acca-70ea068c156f"
|
||||
}
|
||||
, {
|
||||
label: "美国代理",
|
||||
value: "https://mj_jp.bzu.cn",
|
||||
apiId: "babe557a-bbb8-4aed-acca-70ea068c156f"
|
||||
},
|
||||
{
|
||||
label: "LaiTool默认代理",
|
||||
value: "https://mj_us.bzu.cn",
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
export function GetImageProxyUrlOptions(apiId?: string) {
|
||||
debugger
|
||||
if (!apiId) {
|
||||
return ImagePackageProxyOptions
|
||||
}
|
||||
let imageProxyUrl = ImagePackageProxyOptions.filter((item) => item.apiId == apiId || item.apiId == null)
|
||||
if (imageProxyUrl) {
|
||||
return imageProxyUrl
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,9 @@ export enum MJImageType {
|
||||
// 浏览器模式
|
||||
BROWSER_MJ = 'browser_mj',
|
||||
|
||||
// MJ生图包
|
||||
PACKAGE_MJ = 'package_mj',
|
||||
|
||||
// API模式
|
||||
API_MJ = 'api_mj',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user