mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat(combos): add per-combo round-robin strategy
Add ability to configure round-robin strategy for individual combos, similar to per-provider strategy overrides. Changes: - Add comboStrategies setting to store per-combo strategy overrides - Add Round Robin toggle to each combo card in combos page - Update chat handler to check combo-specific strategy before global - Combo-specific strategy takes precedence over global comboStrategy When enabled, each request to that combo will cycle through providers instead of always starting with the first one. Made-with: Cursor
This commit is contained in:
@@ -84,7 +84,11 @@ export async function handleChat(request, clientRawRequest = null) {
|
||||
// Check if model is a combo (has multiple models with fallback)
|
||||
const comboModels = await getComboModels(modelStr);
|
||||
if (comboModels) {
|
||||
const comboStrategy = settings.comboStrategy || "fallback";
|
||||
// Check for combo-specific strategy first, fallback to global
|
||||
const comboStrategies = settings.comboStrategies || {};
|
||||
const comboSpecificStrategy = comboStrategies[modelStr]?.fallbackStrategy;
|
||||
const comboStrategy = comboSpecificStrategy || settings.comboStrategy || "fallback";
|
||||
|
||||
log.info("CHAT", `Combo "${modelStr}" with ${comboModels.length} models (strategy: ${comboStrategy})`);
|
||||
return handleComboChat({
|
||||
body,
|
||||
@@ -111,7 +115,11 @@ async function handleSingleModelChat(body, modelStr, clientRawRequest = null, re
|
||||
const comboModels = await getComboModels(modelStr);
|
||||
if (comboModels) {
|
||||
const chatSettings = await getSettings();
|
||||
const comboStrategy = chatSettings.comboStrategy || "fallback";
|
||||
// Check for combo-specific strategy first, fallback to global
|
||||
const comboStrategies = chatSettings.comboStrategies || {};
|
||||
const comboSpecificStrategy = comboStrategies[modelStr]?.fallbackStrategy;
|
||||
const comboStrategy = comboSpecificStrategy || chatSettings.comboStrategy || "fallback";
|
||||
|
||||
log.info("CHAT", `Combo "${modelStr}" with ${comboModels.length} models (strategy: ${comboStrategy})`);
|
||||
return handleComboChat({
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user