fix(channel): 模型限制以原始请求模型检查定价列表,而非映射后模型
开启 restrict_models 时,应用原始模型名查定价列表; 定价列表未命中即拒绝,不因通配符映射而绕过限制。
This commit is contained in:
@@ -429,8 +429,9 @@ func (s *ChannelService) ResolveChannelMappingAndRestrict(ctx context.Context, g
|
|||||||
if groupID == nil {
|
if groupID == nil {
|
||||||
return mapping, false
|
return mapping, false
|
||||||
}
|
}
|
||||||
|
// 先用原始模型检查定价列表限制,再做映射
|
||||||
|
restricted := s.IsModelRestricted(ctx, *groupID, model)
|
||||||
mapping = s.ResolveChannelMapping(ctx, *groupID, model)
|
mapping = s.ResolveChannelMapping(ctx, *groupID, model)
|
||||||
restricted := s.IsModelRestricted(ctx, *groupID, mapping.MappedModel)
|
|
||||||
return mapping, restricted
|
return mapping, restricted
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user