fix: model过滤支持model_mappings映射,含mappings的单模型ppid也能正确过滤
This commit is contained in:
parent
d7d02ccb6b
commit
a7d88309b8
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user