User:Polygnotus/Scripts/GeminiProofreaderOld.js: Difference between revisions

Content deleted Content added
Cramulator (talk | contribs)
No edit summary
Cramulator (talk | contribs)
No edit summary
Line 592:
if (!wikicode) {
throw new Error('Could not fetch article wikicode');
}
 
if (wikicode.length > 100000) { // Gemini models have input limits, e.g. 1.5 Pro has large context
const confirmed = await new Promise(resolve => {
OO.ui.confirm(`This article is quite long (${wikicode.length} characters). Processing may take a while and use significant API credits. Continue?`)
.done(resolve);
});
 
if (!confirmed) {
this.updateStatus('Operation cancelled by user.');
this.buttons.proofread.setDisabled(false);
return;
}
}
 
Line 612 ⟶ 599:
 
this.updateStatus('Proofreading complete!');
const finalOutput = `== ${articleTitle}: \n${result}`; // Prepend title to proofreading
this.updateOutput(finalOutput, true);
 
Line 708 ⟶ 695:
},
generationConfig: {
maxOutputTokens: 409665536, // Maxshould forbe Geminienough 1.0given Pro,1M 2.5 Pro might betoken higherwindow
temperature: 0.30, // For more factual, less creative output
// topP: 0.9, // Adjust as needed
}
};