feat(usage): add support for tracking request source in usage records

- Introduced `Source` field to usage-related structs for better origin tracking.
- Updated `newUsageReporter` to resolve and populate the `Source` attribute.
- Implemented `resolveUsageSource` to determine source from auth metadata or API key.
This commit is contained in:
Luis Pater
2025-10-14 02:11:43 +08:00
parent f2710c03ab
commit 32a8102d71
3 changed files with 38 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ type Record struct {
Model string
APIKey string
AuthID string
Source string
RequestedAt time.Time
Detail Detail
}