Auto-deploy: 2026-08-05 16:17:53

This commit is contained in:
Hamza-Ayed
2026-08-05 16:17:53 +03:00
parent 83506f00a2
commit 731ced99d1
20 changed files with 1772 additions and 1150 deletions
+7 -3
View File
@@ -36,8 +36,12 @@ async function handleGeminiRequest({ apiKey, prompt, tab, action = 'generateText
throw new Error('Daily limit reached (1,000 requests). Resets at midnight PT.');
}
// Truncate text — 12k chars to fit list_analysis prompts
const maxChars = 12000;
// Safety valve only. Prompts already cap the job description at the source,
// because truncating here removes the END of the prompt — which is where the
// job posting and the required output format sit. Gemini's context window is
// far larger than this; the limit exists to catch runaway input, not to shape
// normal requests.
const maxChars = 60000;
const trimmedPrompt = prompt && prompt.length > maxChars
? prompt.substring(0, maxChars) + '\n\n[Truncated]'
: prompt;
@@ -70,7 +74,7 @@ async function handleGeminiRequest({ apiKey, prompt, tab, action = 'generateText
if (action === 'generatePdf') {
if (!data.pdf) throw new Error('Empty PDF response from server.');
await incrementUsage();
return { pdf: data.pdf, filename: data.filename, fromCache: false };
return { pdf: data.pdf, filename: data.filename, ats: data.ats || null, fromCache: false };
} else if (action === 'generateComment') {
const comment = data.comment;
if (!comment) {