2024-07-13 15:44:13 +08:00
|
|
|
|
let apiUrl = [
|
|
|
|
|
|
{
|
2024-09-04 19:49:20 +08:00
|
|
|
|
label: 'LAI API - 香港',
|
2024-07-13 15:44:13 +08:00
|
|
|
|
value: 'b44c6f24-59e4-4a71-b2c7-3df0c4e35e65',
|
2024-08-08 16:24:47 +08:00
|
|
|
|
gpt_url: 'https://api.laitool.cc/v1/chat/completions',
|
2025-04-08 14:37:35 +08:00
|
|
|
|
isPackage: false,
|
2024-07-13 15:44:13 +08:00
|
|
|
|
mj_url: {
|
2024-08-08 16:24:47 +08:00
|
|
|
|
imagine: 'https://api.laitool.cc/mj/submit/imagine',
|
|
|
|
|
|
describe: 'https://api.laitool.cc/mj/submit/describe',
|
|
|
|
|
|
update_file: 'https://api.laitool.cc/mj/submit/upload-discord-images',
|
|
|
|
|
|
once_get_task: 'https://api.laitool.cc/mj/task/${id}/fetch'
|
2024-07-13 15:44:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
d3_url: {
|
2024-08-08 16:24:47 +08:00
|
|
|
|
image: 'https://api.laitool.cc/v1/images/generations'
|
2024-07-13 15:44:13 +08:00
|
|
|
|
},
|
2025-02-24 17:25:00 +08:00
|
|
|
|
buy_url: 'https://api.laitool.cc/login'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: 'LAI API - 美国',
|
|
|
|
|
|
value: '2b443f53-ba12-42b3-a57c-e4df92685c73',
|
|
|
|
|
|
gpt_url: 'https://laitool.net/v1/chat/completions',
|
2025-04-08 14:37:35 +08:00
|
|
|
|
isPackage: false,
|
2025-02-24 17:25:00 +08:00
|
|
|
|
mj_url: {
|
|
|
|
|
|
imagine: 'https://laitool.net/mj/submit/imagine',
|
|
|
|
|
|
describe: 'https://laitool.net/mj/submit/describe',
|
|
|
|
|
|
update_file: 'https://laitool.net/mj/submit/upload-discord-images',
|
|
|
|
|
|
once_get_task: 'https://laitool.net/mj/task/${id}/fetch'
|
|
|
|
|
|
},
|
|
|
|
|
|
d3_url: {
|
|
|
|
|
|
image: 'https://laitool.net/v1/images/generations'
|
|
|
|
|
|
},
|
|
|
|
|
|
buy_url: 'https://laitool.net/login'
|
2024-06-01 15:08:22 +08:00
|
|
|
|
},
|
2024-07-13 15:44:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: 'openai-hk',
|
|
|
|
|
|
value: '3d64e50e-79c0-49ec-a72d-7dfdf508dd04',
|
|
|
|
|
|
gpt_url: 'https://api.openai-hk.com/v1/chat/completions',
|
|
|
|
|
|
mj_url: null,
|
|
|
|
|
|
buy_url: 'https://openai-hk.com/?i=10196'
|
2024-06-01 15:08:22 +08:00
|
|
|
|
},
|
2024-07-13 15:44:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: '通义千问',
|
|
|
|
|
|
value: 'b630c69a-99e9-46bc-8d88-39a00bcc3d2a',
|
|
|
|
|
|
gpt_url: 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation',
|
|
|
|
|
|
mj_url: null,
|
|
|
|
|
|
buy_url: null
|
2024-06-01 15:08:22 +08:00
|
|
|
|
},
|
2024-07-13 15:44:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: 'KIMI',
|
|
|
|
|
|
value: 'b5c8c8c5-f3c4-4c88-b25c-7f5a3d5f9d1f',
|
|
|
|
|
|
gpt_url: 'https://api.moonshot.cn/v1/chat/completions',
|
|
|
|
|
|
mj_url: null,
|
|
|
|
|
|
d3_url: null,
|
|
|
|
|
|
buy_url: 'https://platform.moonshot.cn/console/account'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: 'DouBao',
|
|
|
|
|
|
value: 'd3f6a2a9-2d17-4c3b-8d7f-28356cfa676e',
|
|
|
|
|
|
gpt_url: 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
|
|
|
|
|
mj_url: null,
|
|
|
|
|
|
d3_url: null,
|
|
|
|
|
|
buy_url: 'https://www.volcengine.com/product/doubao'
|
2025-04-08 14:37:35 +08:00
|
|
|
|
},
|
2025-06-23 22:08:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: 'LaiTool生图包',
|
|
|
|
|
|
value: '9c9023bd-871d-4b63-8004-facb3b66c5b3',
|
|
|
|
|
|
isPackage: true,
|
|
|
|
|
|
mj_url: {
|
|
|
|
|
|
imagine: 'https://lms.laitool.cn/api/mjPackage/mj/submit/imagine',
|
|
|
|
|
|
describe: 'https://lms.laitool.cn/api/mjPackage/mj/submit/describe',
|
|
|
|
|
|
update_file: 'https://lms.laitool.cn/api/mjPackage/mj/submit/upload-discord-images',
|
|
|
|
|
|
once_get_task: 'https://lms.laitool.cn/api/mjPackage/mj/task/${id}/fetch',
|
|
|
|
|
|
query_url: "https://lms.laitool.cn/mjp/task"
|
|
|
|
|
|
},
|
|
|
|
|
|
buy_url: 'https://rvgyir5wk1c.feishu.cn/wiki/P94OwwHuCi2qh8kADutcUuw4nUe'
|
|
|
|
|
|
},
|
2025-04-08 14:37:35 +08:00
|
|
|
|
{
|
|
|
|
|
|
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'
|
2025-06-23 22:08:22 +08:00
|
|
|
|
}
|
2024-07-13 15:44:13 +08:00
|
|
|
|
]
|
2024-06-01 15:08:22 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 通过ID获取指定的数据(value)
|
2024-07-13 15:44:13 +08:00
|
|
|
|
* @param {*} id
|
2024-06-01 15:08:22 +08:00
|
|
|
|
*/
|
|
|
|
|
|
function getApiMessageByID(id) {
|
2024-07-13 15:44:13 +08:00
|
|
|
|
let mj_api_url_index = apiUrl.findIndex((item) => item.value == id)
|
2024-06-01 15:08:22 +08:00
|
|
|
|
if (mj_api_url_index == -1) {
|
2024-07-13 15:44:13 +08:00
|
|
|
|
throw new Error('没有找到对应的MJ API的配置,请先检查配置')
|
2024-06-01 15:08:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-08 14:37:35 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取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 }
|