No staged changes detected. Would you like me to check unstaged changes instead?
This commit is contained in:
@@ -861,11 +861,21 @@ async function runTextOnlyBatch(
|
|||||||
return `${systemText}\n\n<messages_to_analyze>\n${messagesBlock}\n</messages_to_analyze>`;
|
return `${systemText}\n\n<messages_to_analyze>\n${messagesBlock}\n</messages_to_analyze>`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const batchResult = await callModerationLLM(
|
const batchResult = await Promise.race([
|
||||||
buildContent,
|
callModerationLLM(buildContent, targetIds, `text-batch-${i + 1}`),
|
||||||
targetIds,
|
new Promise<{ results: AnalysisResult[]; raw: unknown }>((_, reject) => {
|
||||||
`text-batch-${i + 1}`,
|
const timeout = setTimeout(
|
||||||
);
|
() =>
|
||||||
|
reject(
|
||||||
|
new Error(
|
||||||
|
`Text-only batch sub-batch ${i + 1} timed out for messages ${targetIds.join(", ")}`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
timeoutMs,
|
||||||
|
);
|
||||||
|
timeout.unref();
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
|
||||||
allResults.push(...batchResult.results);
|
allResults.push(...batchResult.results);
|
||||||
if (batchResult.raw) lastRaw = batchResult.raw;
|
if (batchResult.raw) lastRaw = batchResult.raw;
|
||||||
|
|||||||
Reference in New Issue
Block a user