Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion backend/src/services/ai.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,19 @@
if (this.geminiKeys.length === 0) {
const keysEnv = process.env.GEMINI_API_KEYS;
if (keysEnv) {
this.geminiKeys = keysEnv.split(',').map((k) => k.trim()).filter(Boolean);

Check failure on line 70 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Replace `.split(',').map((k)·=>·k.trim())` with `⏎··········.split(',')⏎··········.map((k)·=>·k.trim())⏎··········`
} else {
const key1 = process.env.GEMINI_API_KEY || 'GEMINI_API_KEY_1_PLACEHOLDER';

Check failure on line 72 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Insert `⏎·········`
const key2 = process.env.GEMINI_API_KEY_2 || 'GEMINI_API_KEY_2_PLACEHOLDER';

Check failure on line 73 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Insert `⏎·········`
const key3 = process.env.GEMINI_API_KEY_3 || 'GEMINI_API_KEY_3_PLACEHOLDER';

Check failure on line 74 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Insert `⏎·········`
this.geminiKeys = [key1, key2, key3];
const key4 = process.env.GEMINI_API_KEY_4 || 'GEMINI_API_KEY_4_PLACEHOLDER';

Check failure on line 75 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Insert `⏎·········`
const key5 = process.env.GEMINI_API_KEY_5 || 'GEMINI_API_KEY_5_PLACEHOLDER';

Check failure on line 76 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Insert `⏎·········`

Check failure on line 77 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Delete `········`
const filtered = [key1, key2, key3, key4, key5].filter(
(k) => !k.includes('PLACEHOLDER')
);

Check failure on line 81 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Delete `········`
this.geminiKeys = filtered.length > 0 ? filtered : [key1];
}
}
}
Expand Down Expand Up @@ -1381,7 +1388,7 @@
});
const text = response.text;
if (!text) {
throw new Error('Gemini returned an empty link categorization response.');

Check failure on line 1391 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Replace `'Gemini·returned·an·empty·link·categorization·response.'` with `⏎··············'Gemini·returned·an·empty·link·categorization·response.'⏎············`
}
return text;
});
Expand Down Expand Up @@ -1621,7 +1628,7 @@

const text = response.text;
if (!text) {
throw new Error('Gemini returned an empty deadline extraction response.');

Check failure on line 1631 in backend/src/services/ai.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Replace `'Gemini·returned·an·empty·deadline·extraction·response.'` with `⏎··········'Gemini·returned·an·empty·deadline·extraction·response.'⏎········`
}
return text;
});
Expand Down
Loading