mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
- Added Hermes tool to CLI tools and updated related components.
This commit is contained in:
@@ -41,13 +41,24 @@ export const RETRY_CONFIG = {
|
||||
delayMs: 2000
|
||||
};
|
||||
|
||||
// Default retry config by status code (number of retry attempts)
|
||||
// Default retry config by status code: { attempts, delayMs }
|
||||
// Backward compat: if value is a number, treated as attempts with RETRY_CONFIG.delayMs
|
||||
export const DEFAULT_RETRY_CONFIG = {
|
||||
429: 0, // Rate limit - no retry, use account fallback instead
|
||||
503: 1, // Service unavailable - retry 1 time (transient)
|
||||
502: 1 // Bad gateway - retry 1 time (transient)
|
||||
429: { attempts: 0, delayMs: 0 },
|
||||
502: { attempts: 1, delayMs: 3000 },
|
||||
503: { attempts: 1, delayMs: 2000 }
|
||||
};
|
||||
|
||||
// Normalize a retry entry to { attempts, delayMs }
|
||||
export function resolveRetryEntry(entry) {
|
||||
if (entry == null) return { attempts: 0, delayMs: RETRY_CONFIG.delayMs };
|
||||
if (typeof entry === "number") return { attempts: entry, delayMs: RETRY_CONFIG.delayMs };
|
||||
return {
|
||||
attempts: entry.attempts || 0,
|
||||
delayMs: entry.delayMs != null ? entry.delayMs : RETRY_CONFIG.delayMs
|
||||
};
|
||||
}
|
||||
|
||||
// Requests containing these texts will bypass provider
|
||||
export const SKIP_PATTERNS = [
|
||||
"Please write a 5-10 word title for the following conversation:"
|
||||
|
||||
Reference in New Issue
Block a user