cargo run --release --example tools_reasoning -- --continous hf-model mistralai/Ministral-3-3B-Reasoning-2512-GGUF Ministral-3-3B-Reasoning-2512-Q4_K_M.gguf
....
thread 'main' (142586) panicked at llama-cpp-2/../examples/tools_reasoning.rs:459:18:
Failed to apply follow-up chat template: FfiError(-3)
The reason is a "reasoning_content":null in the conversation history which causes an exception from
wrapper_oai.cpp:378: inputs.messages = common_chat_msgs_parse_oaicompat(json::parse(params->messages));
This might be one solution:
diff --git a/examples/tools_reasoning.rs b/examples/tools_reasoning.rs
index c18a28f..92d2e30 100644
--- a/examples/tools_reasoning.rs
+++ b/examples/tools_reasoning.rs
@@ -308,7 +308,7 @@ fn assistant_tool_call_message(parsed_message: &serde_json::Value) -> serde_json
"reasoning_content": parsed_message
.get("reasoning_content")
.cloned()
- .unwrap_or(serde_json::Value::Null),
+ .unwrap_or(json!("")),
"tool_calls": tool_calls,
})
}
The reason is a
"reasoning_content":nullin the conversation history which causes an exception fromThis might be one solution: