fix(gateway): normalize model alias billing identity
This commit is contained in:
@@ -687,11 +687,16 @@ func (s *Store) SettleTaskBilling(ctx context.Context, task GatewayTask) error {
|
||||
if currency == "" || currency == "mixed" {
|
||||
currency = "resource"
|
||||
}
|
||||
modelIdentity := taskBillingModelIdentity(task)
|
||||
metadataMap := map[string]any{
|
||||
"taskId": task.ID,
|
||||
"kind": task.Kind,
|
||||
"model": task.Model,
|
||||
"resolvedModel": task.ResolvedModel,
|
||||
"model": modelIdentity.Model,
|
||||
"requestedModel": modelIdentity.RequestedModel,
|
||||
"resolvedModel": modelIdentity.ResolvedModel,
|
||||
"modelName": modelIdentity.ModelName,
|
||||
"modelAlias": modelIdentity.ModelAlias,
|
||||
"providerModel": modelIdentity.ProviderModelName,
|
||||
"billings": task.Billings,
|
||||
"billingSummary": task.BillingSummary,
|
||||
}
|
||||
@@ -814,7 +819,7 @@ func roundMoney(value float64) float64 {
|
||||
|
||||
func taskBillingString(value any) string {
|
||||
if text, ok := value.(string); ok {
|
||||
return text
|
||||
return strings.TrimSpace(text)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user