mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
debug: add image billing resolve logging for troubleshooting
This commit is contained in:
@@ -8207,6 +8207,16 @@ func (s *GatewayService) RecordUsageWithLongContext(ctx context.Context, input *
|
||||
if s.resolver != nil && apiKey.Group != nil {
|
||||
gid := apiKey.Group.ID
|
||||
resolved := s.resolver.Resolve(ctx, PricingInput{Model: billingModel, GroupID: &gid})
|
||||
slog.Info("image billing resolve debug",
|
||||
"billing_model", billingModel,
|
||||
"group_id", gid,
|
||||
"resolved_source", resolved.Source,
|
||||
"resolved_mode", resolved.Mode,
|
||||
"has_base_pricing", resolved.BasePricing != nil,
|
||||
"billing_model_source", input.BillingModelSource,
|
||||
"channel_mapped_model", input.ChannelMappedModel,
|
||||
"original_model", input.OriginalModel,
|
||||
)
|
||||
if resolved.Source == "channel" && resolved.Mode == BillingModeToken {
|
||||
useImageTokenBilling = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user