fix(audit): aumentando timeouts de fetch para 10 minutos para suportar modelos de raciocínio profundo
This commit is contained in:
@@ -68,7 +68,7 @@ async function callOpenAI(
|
||||
'Authorization': `Bearer ${config.apiKey}`,
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
}, 180000, signal);
|
||||
}, 600000, signal);
|
||||
const data = await response.json() as { choices?: { message?: { content?: string } }[]; error?: { message?: string } };
|
||||
if (data.error) throw new Error(`OpenAI error: ${data.error.message}`);
|
||||
const content = data.choices?.[0]?.message?.content;
|
||||
@@ -103,7 +103,7 @@ async function callAnthropic(
|
||||
'anthropic-dangerous-direct-browser-access': 'true',
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
}, 180000, signal);
|
||||
}, 600000, signal);
|
||||
const data = await response.json() as { content?: { text?: string }[]; error?: { type?: string; message?: string } };
|
||||
if (data.error) throw new Error(`Anthropic error: ${data.error.message}`);
|
||||
const text = data.content?.[0]?.text;
|
||||
@@ -136,7 +136,7 @@ async function callMinimax(
|
||||
'Authorization': `Bearer ${config.apiKey}`,
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
}, 180000, signal);
|
||||
}, 600000, signal);
|
||||
const data = await response.json() as { choices?: { message?: { content?: string } }[]; error?: { message?: string } };
|
||||
if (data.error) throw new Error(`MiniMax error: ${data.error.message}`);
|
||||
const content = data.choices?.[0]?.message?.content;
|
||||
@@ -170,7 +170,7 @@ async function callOpenRouter(
|
||||
'X-Title': 'BrainWind NBR 6123',
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
}, 180000, signal);
|
||||
}, 600000, signal);
|
||||
if (!response.ok) {
|
||||
const errText = await response.text();
|
||||
throw new Error(`OpenRouter HTTP ${response.status}: ${errText}`);
|
||||
@@ -205,7 +205,7 @@ async function callOllama(
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body),
|
||||
}, 300000, signal);
|
||||
}, 600000, signal);
|
||||
const data = await response.json() as { message?: { content?: string }; error?: string };
|
||||
if (data.error) throw new Error(`Ollama error: ${data.error}`);
|
||||
if (!data.message?.content) throw new Error('Ollama returned empty response');
|
||||
|
||||
Reference in New Issue
Block a user