mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-10 09:00:14 +01:00
add fallback error for /status
This commit is contained in:
parent
ed96ec5c3e
commit
60e1d10263
@ -483,9 +483,12 @@ router.post('/status', jsonParser, async function (request, response_getstatus_o
|
|||||||
api_key_openai = readSecret(SECRET_KEYS.OPENROUTER);
|
api_key_openai = readSecret(SECRET_KEYS.OPENROUTER);
|
||||||
// OpenRouter needs to pass the referer: https://openrouter.ai/docs
|
// OpenRouter needs to pass the referer: https://openrouter.ai/docs
|
||||||
headers = { 'HTTP-Referer': request.headers.referer };
|
headers = { 'HTTP-Referer': request.headers.referer };
|
||||||
} else {
|
} else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.MISTRALAI) {
|
||||||
api_url = 'https://api.mistral.ai/v1';
|
api_url = 'https://api.mistral.ai/v1';
|
||||||
api_key_openai = readSecret(SECRET_KEYS.MISTRALAI);
|
api_key_openai = readSecret(SECRET_KEYS.MISTRALAI);
|
||||||
|
} else {
|
||||||
|
console.log('This chat completion source is not supported yet.');
|
||||||
|
return response_getstatus_openai.status(400).send({ error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!api_key_openai && !request.body.reverse_proxy) {
|
if (!api_key_openai && !request.body.reverse_proxy) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user