[router] add dsr1, kimi, and qwen reasoning parser (#9353)

This commit is contained in:
Simo Lin
2025-08-19 10:15:24 -07:00
committed by GitHub
parent f4fafacc5d
commit 94959237bf
8 changed files with 463 additions and 58 deletions

View File

@@ -96,14 +96,14 @@ pub struct ParserConfig {
/// The token that marks the end of reasoning content.
pub think_end_token: String,
/// Whether to force all text to be treated as reasoning.
pub force_reasoning: bool,
/// Whether to stream reasoning content as it arrives.
pub stream_reasoning: bool,
/// Maximum buffer size in bytes.
pub max_buffer_size: usize,
/// Initial state for in_reasoning flag (fixed per parser type).
pub initial_in_reasoning: bool,
}
impl Default for ParserConfig {
@@ -111,9 +111,9 @@ impl Default for ParserConfig {
Self {
think_start_token: "<think>".to_string(),
think_end_token: "</think>".to_string(),
force_reasoning: false,
stream_reasoning: true,
max_buffer_size: 65536, // 64KB default
max_buffer_size: 65536, // 64KB default
initial_in_reasoning: false, // Default to false (explicit reasoning)
}
}
}