Skip to content

Commit 56b8f70

Browse files
yossiovadiarootfs
authored andcommitted
fix: use unified classifier in intent classification API when available (vllm-project#320)
The Classification API's /api/v1/classify/intent endpoint was returning placeholder "general" category responses with 0.5 confidence instead of performing actual classification using the unified classifier. Changes: - Update handleIntentClassification() to check for unified classifier availability first - Use ClassifyIntentUnified() when unified classifier is available - Fall back to legacy ClassifyIntent() when unified classifier not available - Maintain backward compatibility with existing API contract This resolves the issue where the single classification API always returned hardcoded placeholder responses instead of performing actual BERT-based classification. Fixes vllm-project#303 Signed-off-by: Yossi Ovadia <[email protected]> Co-authored-by: Huamin Chen <[email protected]> Signed-off-by: liuhy <[email protected]>
1 parent 3cd3754 commit 56b8f70

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/semantic-router/pkg/api/server.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,16 @@ func (s *ClassificationAPIServer) handleIntentClassification(w http.ResponseWrit
232232
return
233233
}
234234

235-
response, err := s.classificationSvc.ClassifyIntent(req)
235+
// Use unified classifier if available, otherwise fall back to legacy
236+
var response *services.IntentResponse
237+
var err error
238+
239+
if s.classificationSvc.HasUnifiedClassifier() {
240+
response, err = s.classificationSvc.ClassifyIntentUnified(req)
241+
} else {
242+
response, err = s.classificationSvc.ClassifyIntent(req)
243+
}
244+
236245
if err != nil {
237246
s.writeErrorResponse(w, http.StatusInternalServerError, "CLASSIFICATION_ERROR", err.Error())
238247
return

0 commit comments

Comments
 (0)