diff --git a/content.js b/content.js index 4fdf824..319dd96 100644 --- a/content.js +++ b/content.js @@ -1054,12 +1054,16 @@ Brief honest assessment of this opportunity for my profile` headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ contents: [{ parts: [{ text: promptStr }] }], - generationConfig: { temperature: 0.1, responseMimeType: "application/json" } + generationConfig: { maxOutputTokens: 8192, temperature: 0.1 } }) } ); - if (!response.ok) throw new Error('API Request failed'); + if (!response.ok) { + const errData = await response.json().catch(() => ({})); + console.error('[LJA] API Error:', errData); + throw new Error('API Error: ' + (errData?.error?.message || response.status)); + } const data = await response.json(); if (!data.candidates || !data.candidates[0].content) { throw new Error('API blocked or returned empty response.'); diff --git a/test_gemini.js b/test_gemini.js new file mode 100644 index 0000000..e20e0d3 --- /dev/null +++ b/test_gemini.js @@ -0,0 +1,2 @@ +const fs = require('fs'); +const settings = JSON.parse(fs.readFileSync('/Users/hamzaaleghwairyeen/.gemini/antigravity/brain/1fc80e71-ad9e-4306-9d23-0fcef50f8b3e/scratch/settings.json', 'utf8').catch ? '{}' : '{}'); // wait, I don't have his API key here...