[router] add reasoning and tool parser argument in router (#11290)

This commit is contained in:
Simo Lin
2025-10-07 09:08:32 -04:00
committed by GitHub
parent 1519a89cfd
commit 79d3495177
13 changed files with 188 additions and 20 deletions

View File

@@ -63,6 +63,8 @@ impl TestContext {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
Self::new_with_config(config, worker_configs).await
@@ -1396,6 +1398,8 @@ mod error_tests {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
let ctx = TestContext::new_with_config(
@@ -1755,6 +1759,8 @@ mod pd_mode_tests {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
// Create app context
@@ -1915,6 +1921,8 @@ mod request_id_tests {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
let ctx = TestContext::new_with_config(

View File

@@ -76,6 +76,8 @@ async fn test_non_streaming_mcp_minimal_e2e_with_persistence() {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
// Create router and context
@@ -508,6 +510,8 @@ async fn test_multi_turn_loop_with_mcp() {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
let ctx = AppContext::new(router_cfg, reqwest::Client::new(), 64, None).expect("ctx");
@@ -686,6 +690,8 @@ async fn test_max_tool_calls_limit() {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
let ctx = AppContext::new(router_cfg, reqwest::Client::new(), 64, None).expect("ctx");
@@ -826,6 +832,8 @@ async fn setup_streaming_mcp_test() -> (
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
let ctx = AppContext::new(router_cfg, reqwest::Client::new(), 64, None).expect("ctx");

View File

@@ -826,6 +826,8 @@ fn oracle_config_validation_requires_config_when_enabled() {
},
history_backend: HistoryBackend::Oracle,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
..Default::default()
};

View File

@@ -195,6 +195,8 @@ mod test_pd_routing {
tokenizer_path: None,
history_backend: sglang_router_rs::config::HistoryBackend::Memory,
oracle: None,
reasoning_parser: None,
tool_call_parser: None,
};
let app_context =