[router][tool call] Clean up redundant detect_format and has_tool_markers (#11270)

This commit is contained in:
Chang Su
2025-10-06 14:04:02 -07:00
committed by GitHub
parent 155cbb51f0
commit 466992b2d0
25 changed files with 73 additions and 114 deletions

View File

@@ -98,14 +98,13 @@ fn test_kimik2_format_detection() {
let parser = KimiK2Parser::new();
// Should detect Kimi K2 format
assert!(parser.detect_format("<|tool_calls_section_begin|>"));
assert!(parser.detect_format("<|tool_call_begin|>"));
assert!(parser.detect_format("text with <|tool_calls_section_begin|> marker"));
assert!(parser.has_tool_markers("<|tool_calls_section_begin|>"));
assert!(parser.has_tool_markers("text with <|tool_calls_section_begin|> marker"));
// Should not detect other formats
assert!(!parser.detect_format("[TOOL_CALLS]"));
assert!(!parser.detect_format("<tool_call>"));
assert!(!parser.detect_format("plain text"));
assert!(!parser.has_tool_markers("[TOOL_CALLS]"));
assert!(!parser.has_tool_markers("<tool_call>"));
assert!(!parser.has_tool_markers("plain text"));
}
#[tokio::test]