Update: 2026-05-12 01:35:12

This commit is contained in:
Hamza-Ayed
2026-05-12 01:35:12 +03:00
parent ae5eba09aa
commit e8a9b59a46
2 changed files with 6 additions and 6 deletions

View File

@@ -106,6 +106,11 @@ class AI
return null;
}
// If the AI returns an array of invoices, extract the first one
if (isset($data['invoices']) && is_array($data['invoices']) && count($data['invoices']) > 0) {
$data = $data['invoices'][0];
}
// Track token usage from Gemini response
$usage = $result['usageMetadata'] ?? [];
if (!empty($usage)) {