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:
parent
b80d633cf5
commit
8454082f93
@ -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\"}}}",
|
||||
},
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user