Expose "Allow fallback providers" for OpenRouter

This commit is contained in:
Cohee
2024-07-19 23:34:16 +03:00
parent d8809238a7
commit 5f2a73ac9f
6 changed files with 33 additions and 16 deletions

View File

@@ -879,7 +879,7 @@ router.post('/generate', jsonParser, function (request, response) {
if (Array.isArray(request.body.provider) && request.body.provider.length > 0) {
bodyParams['provider'] = {
allow_fallbacks: true,
allow_fallbacks: request.body.allow_fallbacks ?? true,
order: request.body.provider ?? [],
};
}

View File

@@ -309,7 +309,7 @@ router.post('/generate', jsonParser, async function (request, response) {
if (request.body.api_type === TEXTGEN_TYPES.OPENROUTER) {
if (Array.isArray(request.body.provider) && request.body.provider.length > 0) {
request.body.provider = {
allow_fallbacks: true,
allow_fallbacks: request.body.allow_fallbacks ?? true,
order: request.body.provider,
};
} else {