pub mod harmony;
pub mod tag_based;
pub use harmony::{HarmonyContext, HarmonyToolCall};
pub use tag_based::TagReasoningContext;
pub trait ReasoningParser: Send + Sync {
fn process_bytes(&mut self, bytes: &[u8]);
fn process_token(&mut self, _token_id: u32) {}
fn finalize(&mut self);
fn get_content_delta(&mut self) -> Option<String>;
fn get_reasoning_delta(&mut self) -> Option<String>;
fn content(&self) -> Option<String>;
fn reasoning_content(&self) -> Option<String>;
fn has_tool_calls(&self) -> bool {
false
}
fn finalize_tool_calls(&mut self) -> Vec<harmony::HarmonyToolCall> {
vec![]
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ReasoningMode {
Harmony,
TagBased,
}
pub fn is_reasoning_template(template: &str) -> bool {
tag_based::is_think_tag_template(template) || tag_based::is_channel_tag_template(template)
}