[Rust Frontend] Add roundtrip fixtures for more chat parsers (#47883)
Co-authored-by: Bugen Zhao <i@bugenzhao.com> Signed-off-by: reidliu41 <reid201711@gmail.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Reid committed
Jul 10, 2026 at 18:03 UTC
c241c7a2b015f8168d1c75e80cee15e45c18ba94
1 file changed
+42
rust/src/chat/tests/roundtrip.rs
+42
@@ -117,6 +117,19 @@ impl RoundtripCase {
117
}
118
}
119
120
+ /// MiniMax M3 invoke format with `<mm:think>` reasoning tags.
121
+ fn minimax_m3() -> Self {
122
+ Self {
123
+ model_id: "MiniMaxAI/MiniMax-M3",
124
+ assistant_stop_suffix: "[e~[\n",
125
+ tool_call_parser: ParserSelection::Auto,
126
+ reasoning_parser: ParserSelection::Auto,
127
+ thinking_behavior: ThinkingBehavior::Always { value: true },
128
+ json_fmt: compact_json_fmt(),
129
+ sort_json_keys: false,
130
+ }
131
+ }
132
+
133
/// DeepSeek V4 DSML tool-call format.
134
fn deepseek_v4() -> Self {
135
Self {
@@ -143,6 +156,19 @@ impl RoundtripCase {
156
}
157
}
158
159
+ /// GLM-4.5 XML-like argument format with `<think>` reasoning tags.
160
+ fn glm45() -> Self {
161
+ Self {
162
+ model_id: "zai-org/GLM-4.5",
163
+ assistant_stop_suffix: "",
164
+ tool_call_parser: ParserSelection::Auto,
165
+ reasoning_parser: ParserSelection::Auto,
166
+ thinking_behavior: ThinkingBehavior::Toggleable { default: true },
167
+ json_fmt: compact_json_fmt(),
168
+ sort_json_keys: false,
169
+ }
170
+ }
171
+
172
/// GLM-4.7 XML-like argument format with `<think>` reasoning tags.
173
fn glm47() -> Self {
174
Self {
@@ -209,6 +235,19 @@ impl RoundtripCase {
235
}
236
}
237
238
+ /// Nemotron V3 with `<think>` / `</think>` reasoning tags.
239
+ fn nemotron_v3() -> Self {
240
+ Self {
241
+ model_id: "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16",
242
+ assistant_stop_suffix: "<|im_end|>\n",
243
+ tool_call_parser: ParserSelection::Auto,
244
+ reasoning_parser: ParserSelection::Auto,
245
+ thinking_behavior: ThinkingBehavior::Always { value: true },
246
+ json_fmt: compact_json_fmt(),
247
+ sort_json_keys: false,
248
+ }
249
+ }
250
+
251
/// GPT-OSS Harmony token-id renderer and native Harmony output processor.
252
fn gpt_oss() -> Self {
253
Self {
@@ -247,11 +286,14 @@ roundtrip_tests! {
286
qwen3 => [reasoning_and_content, tool_call_mix],
287
qwen35 => [reasoning_and_content, tool_call_mix],
288
minimax_m25 => [reasoning_and_content, tool_call_mix],
289
+ minimax_m3 => [reasoning_and_content, tool_call_mix],
290
deepseek_v4 => [reasoning_and_content, tool_call_mix],
291
deepseek_v32 => [tool_call_mix],
292
+ glm45 => [reasoning_and_content, tool_call_mix],
293
glm47 => [reasoning_and_content, tool_call_mix],
294
seed_oss => [reasoning_and_content],
295
step3p5 => [reasoning_and_content],
296
+ nemotron_v3 => [reasoning_and_content],
297
gemma4 => [tool_call_mix], // Gemma4 strips reasoning in history if there's no tool call
298
kimi_k25 => [tool_call_mix], // Kimi K2.5 strips reasoning in history
299
gpt_oss => [tool_call_mix], // Harmony strips reasoning in history if there's no tool call