🚀 Fix: Update AI pricing to Flash-Lite and fix build lint error

This commit is contained in:
Hamza-Ayed
2026-04-22 17:51:09 +03:00
parent 6c1d67c695
commit 92fa5a4b49
2 changed files with 6 additions and 7 deletions

View File

@@ -115,11 +115,11 @@ export class InvoiceProcessor {
* حساب تكلفة استخدام Gemini بناءً على التسعيرة الحالية
*/
private calculateCost(usage: any): number {
// Gemini 1.5 Flash Pricing (as of late 2024):
// Prompt: $0.075 / 1M tokens
// Completion: $0.30 / 1M tokens
const promptCost = (usage.promptTokens / 1000000) * 0.075;
const completionCost = (usage.completionTokens / 1000000) * 0.30;
// Gemini 1.5 Flash-Lite Pricing (from user .env):
// Prompt: $0.10 / 1M tokens
// Completion: $0.40 / 1M tokens
const promptCost = (usage.promptTokens / 1000000) * 0.10;
const completionCost = (usage.completionTokens / 1000000) * 0.40;
return promptCost + completionCost;
}

View File

@@ -3,7 +3,6 @@ import {
AlertTriangle,
ShieldAlert,
FileWarning,
ChevronRight,
Search,
Filter,
Loader2,