| 609 | } |
| 610 | |
| 611 | func sumAICFromUsageJSONLFiles(filePaths []string) (float64, bool, error) { |
| 612 | var totalAIC float64 |
| 613 | found := false |
| 614 | |
| 615 | for _, filePath := range filePaths { |
| 616 | fileAIC, fileFound, err := processOneUsageJSONLFile(filePath) |
| 617 | if err != nil { |
| 618 | return 0, false, err |
| 619 | } |
| 620 | totalAIC += fileAIC |
| 621 | if fileFound { |
| 622 | found = true |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | return totalAIC, found, nil |
| 627 | } |
| 628 | |
| 629 | // processOneUsageJSONLFile reads a single usage JSONL file and returns the total AIC |
| 630 | // accumulated from its records. The file is deferred-closed immediately after open. |