- Cap maximum cooldown for rate limit handling in account unavailability and single-model chat flows

- Dynamic custom model fetching for model selection
This commit is contained in:
decolua
2026-04-24 16:14:18 +07:00
parent c42c0146ab
commit cca615eaff
19 changed files with 108 additions and 60 deletions

View File

@@ -71,12 +71,12 @@ function stripContentTypes(body, stripList = []) {
}
// Translate request: source -> openai -> target
export function translateRequest(sourceFormat, targetFormat, model, body, stream = true, credentials = null, provider = null, reqLogger = null, stripList = [], connectionId = null) {
export function translateRequest(sourceFormat, targetFormat, model, body, stream = true, credentials = null, provider = null, reqLogger = null, stripList = [], connectionId = null, rtkEnabled = false) {
ensureInitialized();
let result = body;
// RTK: compress tool_result content before any translation (shape-agnostic)
const rtkStats = compressMessages(result);
const rtkStats = compressMessages(result, rtkEnabled);
if (rtkStats) {
const line = formatRtkLog(rtkStats);
if (line) console.log(line);