Skip to content

Commit a71922c

Browse files
committed
fix: remove duplicated pii classify
Signed-off-by: bitliu <[email protected]>
1 parent b60a085 commit a71922c

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/semantic-router/pkg/extproc/reason_mode_selector.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,6 @@ func (r *OpenAIRouter) shouldUseReasoningMode(query string) bool {
3939
return false
4040
}
4141

42-
// buildRequestBody builds the request body for vLLM inference server with proper reasoning mode settings
43-
func buildRequestBody(model string, messages []map[string]string, useReasoning bool, stream bool) map[string]interface{} {
44-
requestBody := map[string]interface{}{
45-
"model": model,
46-
"messages": messages,
47-
"stream": stream,
48-
}
49-
50-
// Add chat template kwargs if reasoning is enabled
51-
if useReasoning {
52-
requestBody["chat_template_kwargs"] = getChatTemplateKwargs(true)
53-
log.Printf("Added reasoning mode to request for model: %s", model)
54-
} else {
55-
log.Printf("Using standard mode (no reasoning) for model: %s", model)
56-
}
57-
58-
return requestBody
59-
}
60-
6142
// getChatTemplateKwargs returns the appropriate chat template kwargs based on reasoning mode and streaming
6243
func getChatTemplateKwargs(useReasoning bool) map[string]interface{} {
6344
if useReasoning {

src/semantic-router/pkg/extproc/request_handler.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,6 @@ func (r *OpenAIRouter) handleRequestBody(v *ext_proc.ProcessingRequest_RequestBo
190190
func (r *OpenAIRouter) performSecurityChecks(userContent string, nonUserMessages []string) (*ext_proc.ProcessingResponse, bool) {
191191
// Perform PII classification on all message content
192192
allContent := pii.ExtractAllContent(userContent, nonUserMessages)
193-
detectedPII := r.Classifier.DetectPIIInContent(allContent)
194-
195-
if len(detectedPII) > 0 {
196-
log.Printf("Total detected PII types: %v", detectedPII)
197-
} else {
198-
log.Printf("No PII detected in request content")
199-
}
200193

201194
// Perform jailbreak detection on all message content
202195
if r.Classifier.IsJailbreakEnabled() {

0 commit comments

Comments
 (0)