From 92fa5a4b4902f6988f31a8ecca02de39c97c2b62 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Wed, 22 Apr 2026 17:51:09 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Fix:=20Update=20AI=20pricing=20t?= =?UTF-8?q?o=20Flash-Lite=20and=20fix=20build=20lint=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/modules/invoices/invoice.processor.ts | 10 +++++----- frontend/src/pages/dashboard/RiskMonitorPage.tsx | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/src/modules/invoices/invoice.processor.ts b/backend/src/modules/invoices/invoice.processor.ts index abd2eba..ca66e18 100644 --- a/backend/src/modules/invoices/invoice.processor.ts +++ b/backend/src/modules/invoices/invoice.processor.ts @@ -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; } diff --git a/frontend/src/pages/dashboard/RiskMonitorPage.tsx b/frontend/src/pages/dashboard/RiskMonitorPage.tsx index badb0e2..9c1eeb2 100644 --- a/frontend/src/pages/dashboard/RiskMonitorPage.tsx +++ b/frontend/src/pages/dashboard/RiskMonitorPage.tsx @@ -3,9 +3,8 @@ import { AlertTriangle, ShieldAlert, FileWarning, - ChevronRight, Search, - Filter, + Filter, Loader2, Building2, Calendar,