@contentgrowth/llm-service 0.6.96 → 0.6.97
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/package.json
CHANGED
|
@@ -180,9 +180,12 @@ export class GeminiProvider extends BaseLLMProvider {
|
|
|
180
180
|
// Validate that we have EITHER content OR tool calls
|
|
181
181
|
if (!textContent && (!toolCalls || toolCalls.length === 0)) {
|
|
182
182
|
console.error('[GeminiProvider] Model returned empty response (no text, no tool calls)');
|
|
183
|
-
console.error('[GeminiProvider]
|
|
183
|
+
console.error('[GeminiProvider] Finish Reason:', candidate.finishReason);
|
|
184
|
+
console.error('[GeminiProvider] Safety Ratings:', JSON.stringify(candidate.safetyRatings, null, 2));
|
|
185
|
+
console.error('[GeminiProvider] Full Candidate:', JSON.stringify(candidate, null, 2));
|
|
186
|
+
|
|
184
187
|
throw new LLMServiceException(
|
|
185
|
-
|
|
188
|
+
`Model returned empty response. Finish Reason: ${candidate.finishReason}.`,
|
|
186
189
|
500
|
|
187
190
|
);
|
|
188
191
|
}
|
|
@@ -381,10 +384,19 @@ export class GeminiProvider extends BaseLLMProvider {
|
|
|
381
384
|
if (!imagePart || !imagePart.inlineData) {
|
|
382
385
|
// Fallback: Check if it returned a URI or other format, or just text
|
|
383
386
|
const textPart = response.candidates?.[0]?.content?.parts?.find(p => p.text);
|
|
387
|
+
const candidate = response.candidates?.[0];
|
|
388
|
+
|
|
389
|
+
console.error('[GeminiProvider] Image generation failed (no image data)');
|
|
390
|
+
if (candidate) {
|
|
391
|
+
console.error('[GeminiProvider] Finish Reason:', candidate.finishReason);
|
|
392
|
+
console.error('[GeminiProvider] Safety Ratings:', JSON.stringify(candidate.safetyRatings, null, 2));
|
|
393
|
+
console.error('[GeminiProvider] Full Candidate:', JSON.stringify(candidate, null, 2));
|
|
394
|
+
}
|
|
395
|
+
|
|
384
396
|
if (textPart) {
|
|
385
397
|
console.warn('[GeminiProvider] Model returned text instead of image:', textPart.text);
|
|
386
398
|
}
|
|
387
|
-
throw new Error(
|
|
399
|
+
throw new Error(`No image data in response. Finish Reason: ${candidate?.finishReason}`);
|
|
388
400
|
}
|
|
389
401
|
|
|
390
402
|
return {
|
|
@@ -443,6 +455,7 @@ export class GeminiProvider extends BaseLLMProvider {
|
|
|
443
455
|
this._pendingOperations.delete(operationName);
|
|
444
456
|
|
|
445
457
|
if (operation.error) {
|
|
458
|
+
console.error('[GeminiProvider] Video generation failed:', JSON.stringify(operation.error, null, 2));
|
|
446
459
|
result.error = operation.error;
|
|
447
460
|
} else {
|
|
448
461
|
const videoResult = operation.response;
|