diff --git a/pricing/pricing.py b/pricing/pricing.py index f964370..289a853 100644 --- a/pricing/pricing.py +++ b/pricing/pricing.py @@ -797,6 +797,7 @@ async def get_pricing_display(ppid, model=None): pricings = d.get('pricings', []) pricing_type = d.get('pricing_type', 'per_use') unit_values = d.get('unit_values', {'百万': 1000000, '秒': 1, '千': 1000, '次': 1, '张': 1, '毫秒': 0.001, '元/百万tokens': 1000000, '元/total_tokens': 1, '元/times': 1}) + model_mappings = d.get('model_mappings', {}) items = [] for p in pricings: @@ -929,7 +930,8 @@ async def get_pricing_display(ppid, model=None): item_model = item['filters'].get('model') if not item_model and item.get('filter_labels'): item_model = item['filter_labels'].get('模型') - if item_model == model: + # 直接匹配或通过 model_mappings 映射匹配 + if item_model == model or model_mappings.get(item_model) == model: filtered_items.append(item) if filtered_items: items = filtered_items