You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit fixes keyword routing accuracy issues in two E2E test profiles:
1. ai-gateway profile (rule-condition-logic test):
- Fixed incorrect test case expectations
- Test accuracy improved from 66.67% (4/6) to 100% (6/6)
2. routing-strategies profile (keyword-routing test):
- Fixed sensitive_data rule to require only 2 keywords instead of 3
- Removed problematic exclude_spam rule using NOR operator
- Implemented x-vsr-matched-keywords response header feature
- Category accuracy improved from 63.64% (7/11) to 100% (11/11)
The x-vsr-matched-keywords header implementation adds:
- Header constant in pkg/headers/headers.go
- VSRMatchedKeywords field to RequestContext
- ClassifyWithKeywords() method in keyword classifier
- MatchedKeywords field to SignalResults and DecisionResult
- Response header population in processor_res_header.go
All changes are backward compatible and limited to test configurations
and new observability features.
Signed-off-by: Srinivas A <[email protected]>
# Categories define domain metadata only (no routing logic)
@@ -74,9 +70,6 @@ config:
74
70
- name: sensitive_data
75
71
description: "Requests involving sensitive personal data"
76
72
mmlu_categories: ["sensitive_data"]
77
-
- name: exclude_spam
78
-
description: "Potential spam or suspicious requests"
79
-
mmlu_categories: ["exclude_spam"]
80
73
- name: business
81
74
description: "Business and management related queries"
82
75
mmlu_categories: ["business"]
@@ -173,26 +166,6 @@ config:
173
166
enabled: true
174
167
pii_types_allowed: []
175
168
176
-
- name: "exclude_spam_decision"
177
-
description: "Potential spam or suspicious requests"
178
-
priority: 150
179
-
rules:
180
-
operator: "AND"
181
-
conditions:
182
-
- type: "keyword"
183
-
name: "exclude_spam"
184
-
modelRefs:
185
-
- model: "base-model"
186
-
use_reasoning: false
187
-
plugins:
188
-
- type: "system_prompt"
189
-
configuration:
190
-
system_prompt: "You are a content moderation assistant. This request has been flagged as potential spam. Please verify the legitimacy of the request before proceeding."
191
-
- type: "pii"
192
-
configuration:
193
-
enabled: true
194
-
pii_types_allowed: []
195
-
196
169
# Standard category decisions
197
170
- name: "business_decision"
198
171
description: "Business and management related queries"
0 commit comments