Update: 2026-05-12 01:35:12
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user