2
0
mirror of https://github.com/QuantumNous/new-api.git synced 2026-08-31 02:41:34 +00:00

feat(chat): add AQBot preset (#7079)

This commit is contained in:
憧憬Licoy 2026-08-29 20:34:56 +08:00 committed by GitHub
parent b80d633cf5
commit 8454082f93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -25,6 +25,9 @@ var Chats = []map[string]string{
{
"DeepChat": "deepchat://provider/install?v=1&data={deepchatConfig}",
},
{
"AQBot": "aqbot://providers?{aqbotConfig}",
},
{
"Lobe Chat 官方示例": "https://chat-preview.lobehub.com/?settings={\"keyVaults\":{\"openai\":{\"apiKey\":\"{key}\",\"baseURL\":\"{address}/v1\"}}}",
},

View File

@ -89,7 +89,8 @@ export function chatLinkRequiresApiKey(url: string): boolean {
url.includes('{key}') ||
url.includes('{cherryConfig}') ||
url.includes('{aionuiConfig}') ||
url.includes('{deepchatConfig}')
url.includes('{deepchatConfig}') ||
url.includes('{aqbotConfig}')
)
}
@ -189,6 +190,16 @@ export function resolveChatUrl({
return replaceToken(url, '{deepchatConfig}', encoded)
}
if (url.includes('{aqbotConfig}')) {
const query = [
`name=${encodeURIComponent('New API')}`,
`baseurl=${encodeURIComponent(safeServerAddress)}`,
`apikey=${encodeURIComponent(safeApiKey)}`,
'type=openai',
].join('&')
return replaceToken(url, '{aqbotConfig}', query)
}
if (safeServerAddress) {
const encodedAddress = encodeURIComponent(safeServerAddress)
url = replaceToken(url, '{address}', encodedAddress)