main
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-04-25 14:37:46 +02:00
parent ad5a97a4fd
commit 9d8c34b39d
34 changed files with 5853 additions and 164 deletions
+19
View File
@@ -0,0 +1,19 @@
import * as fs from 'fs';
const file = '/Users/haruncan/Documents/GitHub/ContentGenerator/ContentGen_BE/src/modules/gemini/gemini.service.ts';
let content = fs.readFileSync(file, 'utf8');
// Update tryGenerateContentImage signature to return finishReason
content = content.replace(
/Promise<\{ buffer: Buffer; mimeType: string \} \| null>/g,
'Promise<{ buffer: Buffer; mimeType: string; finishReason?: string } | null>'
);
// Update tryGenerateContentImage return
content = content.replace(
/return null;\s*}\s*const imagePart/g,
'return { buffer: Buffer.from([]), mimeType: "", finishReason };\n }\n\n const imagePart'
);
// In tryGenerateContentImage, we need to return the finish reason when buffer is empty so we know it's a safety block.
// Let's just use replace_file_content tool, it's safer than regex.