@@ -46,15 +46,15 @@ function splitStringByTokens(str, maxTokens) {
4646 * Split diff into chunks by file boundaries
4747 */
4848function chunkDiffByFiles ( diffContent ) {
49- console . log ( 'chunkDiffByFiles' ) ;
49+ console . error ( 'chunkDiffByFiles' ) ;
5050 const fileChunks = [ ] ;
5151 const lines = diffContent . split ( '\n' ) ;
5252 let currentChunk = '' ;
5353 let currentFile = '' ;
5454
5555 for ( const line of lines ) {
5656 // Check if this is a new file header
57- console . log ( `Line is estimated at ${ estimateTokens ( line ) } tokens` ) ;
57+ console . error ( `Line is estimated at ${ estimateTokens ( line ) } tokens` ) ;
5858 if ( line . startsWith ( 'diff --git' ) || line . startsWith ( '+++' ) || line . startsWith ( '---' ) ) {
5959 // If we have content and it's getting large, save current chunk
6060 if ( currentChunk && estimateTokens ( currentChunk + '\n' + line ) > MAX_TOKENS_PER_REQUEST ) {
@@ -158,7 +158,7 @@ ${diffContent}`;
158158 * Call Gemini API with the given prompt
159159 */
160160async function callGeminiAPI ( prompt , apiKey ) {
161- console . log ( `Sending prompt with an estimated ${ estimateTokens ( prompt ) } tokens` ) ;
161+ console . error ( `Sending prompt with an estimated ${ estimateTokens ( prompt ) } tokens` ) ;
162162 return 'gemini' ; /*
163163 const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${apiKey}`, {
164164 method: 'POST',
@@ -201,7 +201,7 @@ async function callGeminiAPI(prompt, apiKey) {
201201 * Process diff chunks and combine results
202202 */
203203async function processChunks ( chunks , apiKey ) {
204- console . log ( 'processchunks' ) ;
204+ console . error ( 'processchunks' ) ;
205205 if ( chunks . length === 1 ) {
206206 // Single chunk, process normally
207207 return await callGeminiAPI ( createPRPrompt ( chunks [ 0 ] . content ) , apiKey ) ;
0 commit comments