🚀 Fix: Update AI pricing to Flash-Lite and fix build lint error
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@ import {
|
||||
AlertTriangle,
|
||||
ShieldAlert,
|
||||
FileWarning,
|
||||
ChevronRight,
|
||||
Search,
|
||||
Filter,
|
||||
Filter,
|
||||
Loader2,
|
||||
Building2,
|
||||
Calendar,
|
||||
|
||||
Reference in New Issue
Block a user