blaze-performance-tester 3.1.43 → 3.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +12 -3
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -135,12 +135,21 @@ CRITICAL: Return ONLY plain paragraph text. Do not use markdown headers (###). I
|
|
|
135
135
|
})
|
|
136
136
|
});
|
|
137
137
|
const data = await response.json();
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
if (data?.error) {
|
|
139
|
+
throw new Error(`Google API Error ${data.error.code}: ${data.error.message}`);
|
|
140
|
+
}
|
|
141
|
+
const candidate = data?.candidates?.[0];
|
|
142
|
+
if (candidate?.finishReason && candidate.finishReason !== "STOP") {
|
|
143
|
+
throw new Error(`Generation halted by Gemini API. Reason: ${candidate.finishReason}`);
|
|
144
|
+
}
|
|
145
|
+
const candidateText = candidate?.content?.parts?.[0]?.text;
|
|
146
|
+
if (!candidateText) {
|
|
147
|
+
throw new Error(`Malformed API layout or empty response body. Raw Payload: ${JSON.stringify(data)}`);
|
|
148
|
+
}
|
|
140
149
|
return candidateText.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\n/g, "<br>");
|
|
141
150
|
} catch (error) {
|
|
142
151
|
console.error("\u274C Gemini API processing breakdown failure:", error);
|
|
143
|
-
return `<span style="color: #f87171;">Failed to generate AI diagnosis framework: ${error.message}</span>`;
|
|
152
|
+
return `<span style="color: #f87171;">Failed to generate AI diagnosis framework: ${error.message || error}</span>`;
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
155
|
async function executeTestPipeline(config) {
|
|
Binary file
|