V 2.2.6 增加了MJ的api
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
let apiUrl = [{
|
||||
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"
|
||||
}, {
|
||||
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
|
||||
}, {
|
||||
label: "DrawAPI(MJ)",
|
||||
value: "2cabf684-ac48-4733-a427-8c41626f7d8f",
|
||||
gpt_url: null,
|
||||
mj_url: {
|
||||
imagine: "https://mjapi.deepwl.net/api/mj/submit/imagine",
|
||||
describe: "https://mjapi.deepwl.net/api/mj/submit/describe",
|
||||
update_file: "https://mjapi.deepwl.net/api/mj/submit/upload-discord-images",
|
||||
once_get_task: "https://mjapi.deepwl.net/api/mj/query/task/${id}",
|
||||
get_task_list: "https://mjapi.deepwl.net/api/mj/task/list-by-condition"
|
||||
},
|
||||
d3_url: null,
|
||||
buy_url: "https://mjapi.deepwl.net/#/home"
|
||||
}, {
|
||||
label: "ePhoneAPI",
|
||||
value: "b8866543-8c27-4888-869c-00aa1eb31272",
|
||||
gpt_url: "https://api.ephone.ai/v1/chat/completions",
|
||||
mj_url: {
|
||||
imagine: "https://api.ephone.ai/mj/submit/imagine",
|
||||
describe: "https://api.ephone.ai/mj/submit/describe",
|
||||
update_file: "https://api.ephone.ai/mj/submit/upload-discord-images",
|
||||
once_get_task: "https://api.ephone.ai/mj/task/${id}/fetch",
|
||||
},
|
||||
d3_url: {
|
||||
image: "https://api.ephone.ai/v1/images/generations"
|
||||
},
|
||||
buy_url: "https://ephone.ai/register?aff=55XT"
|
||||
}]
|
||||
|
||||
/**
|
||||
* 通过ID获取指定的数据(value)
|
||||
* @param {*} id
|
||||
*/
|
||||
function getApiMessageByID(id) {
|
||||
let mj_api_url_index = apiUrl.findIndex(item => item.value == id)
|
||||
if (mj_api_url_index == -1) {
|
||||
throw new Error("没有找到对应的MJ API的配置,请先检查配置")
|
||||
}
|
||||
|
||||
}
|
||||
export {
|
||||
apiUrl,
|
||||
getApiMessageByID
|
||||
}
|
||||
Reference in New Issue
Block a user