feat: filter candidates by request resolution
This commit is contained in:
@@ -19,7 +19,12 @@ type EstimateResult struct {
|
||||
|
||||
func (s *Service) Estimate(ctx context.Context, kind string, model string, body map[string]any, user *auth.User) (EstimateResult, error) {
|
||||
body = normalizeRequest(kind, body)
|
||||
candidates, err := s.store.ListModelCandidates(ctx, model, modelTypeFromKind(kind, body), user)
|
||||
modelType := modelTypeFromKind(kind, body)
|
||||
candidates, err := s.store.ListModelCandidates(ctx, model, modelType, user)
|
||||
if err != nil {
|
||||
return EstimateResult{}, err
|
||||
}
|
||||
candidates, _, err = filterRuntimeCandidatesByRequest(kind, model, modelType, body, candidates)
|
||||
if err != nil {
|
||||
return EstimateResult{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user