Skip to content

Commit db4a491

Browse files
committed
fix(classifier): resolve makeReasoningDecisionForCategory after PR #681 merge
After PR #681 merge, Categories no longer have ModelScores field. The reasoning config moved to Decisions.ModelRefs, but there's no direct mapping from category names to decision names. Set useReasoning=false as safe default until proper category-to-decision mapping is implemented. Related: PR #648, PR #681 Signed-off-by: Yossi Ovadia <[email protected]>
1 parent f8a355b commit db4a491

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/semantic-router/pkg/classification/classifier.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -732,18 +732,14 @@ func (c *Classifier) classifyWithUnifiedClassifier(text string) (string, float64
732732

733733
// makeReasoningDecisionForCategory creates reasoning decision based on category config
734734
func (c *Classifier) makeReasoningDecisionForCategory(category string, confidence float64) entropy.ReasoningDecision {
735-
normalizedCategory := strings.ToLower(strings.TrimSpace(category))
735+
// Note: In the new config architecture, reasoning configuration has moved from
736+
// categories to decisions. However, the unified LoRA classifier returns category names
737+
// (e.g., "business") while decisions have different names (e.g., "business_decision").
738+
// For now, default to useReasoning=false since there's no direct mapping from
739+
// category name to decision. This maintains backward compatibility and allows
740+
// the system to function without reasoning until proper decision mapping is implemented.
736741
useReasoning := false
737742

738-
for _, cat := range c.Config.Categories {
739-
if strings.ToLower(cat.Name) == normalizedCategory {
740-
if len(cat.ModelScores) > 0 && cat.ModelScores[0].UseReasoning != nil {
741-
useReasoning = *cat.ModelScores[0].UseReasoning
742-
}
743-
break
744-
}
745-
}
746-
747743
return entropy.ReasoningDecision{
748744
UseReasoning: useReasoning,
749745
Confidence: confidence,

0 commit comments

Comments
 (0)