feat: filter candidates by request resolution

This commit is contained in:
2026-05-18 15:50:08 +08:00
parent ba419cd90a
commit 73c6d43e4b
9 changed files with 629 additions and 18 deletions
+6 -1
View File
@@ -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
}