add Qwen3.5 model

This commit is contained in:
jhqxxx
2026-03-05 21:57:03 +08:00
parent a61b899741
commit 4ae8b0b2f4
31 changed files with 1930 additions and 121 deletions
+21
View File
@@ -131,4 +131,25 @@ impl<'a> ChatTemplate<'a> {
.map_err(|e| anyhow!(format!("render template error {}", e)))?;
Ok(message_str)
}
pub fn apply_chat_temp_think(
&self,
messages: &ChatCompletionParameters,
enable_thinking: Option<bool>,
) -> Result<String> {
let context = context! {
messages => &messages.messages,
tools => &messages.tools.as_ref(),
add_generation_prompt => true,
enable_thinking => enable_thinking,
};
let template = self
.env
.get_template("chat")
.map_err(|e| anyhow!(format!("render template error {}", e)))?;
let message_str = template
.render(context)
.map_err(|e| anyhow!(format!("render template error {}", e)))?;
Ok(message_str)
}
}