[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>
This commit is contained in:
@@ -117,6 +117,19 @@ impl RoundtripCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// MiniMax M3 invoke format with `<mm:think>` reasoning tags.
|
||||||
|
fn minimax_m3() -> Self {
|
||||||
|
Self {
|
||||||
|
model_id: "MiniMaxAI/MiniMax-M3",
|
||||||
|
assistant_stop_suffix: "[e~[\n",
|
||||||
|
tool_call_parser: ParserSelection::Auto,
|
||||||
|
reasoning_parser: ParserSelection::Auto,
|
||||||
|
thinking_behavior: ThinkingBehavior::Always { value: true },
|
||||||
|
json_fmt: compact_json_fmt(),
|
||||||
|
sort_json_keys: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// DeepSeek V4 DSML tool-call format.
|
/// DeepSeek V4 DSML tool-call format.
|
||||||
fn deepseek_v4() -> Self {
|
fn deepseek_v4() -> Self {
|
||||||
Self {
|
Self {
|
||||||
@@ -143,6 +156,19 @@ impl RoundtripCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// GLM-4.5 XML-like argument format with `<think>` reasoning tags.
|
||||||
|
fn glm45() -> Self {
|
||||||
|
Self {
|
||||||
|
model_id: "zai-org/GLM-4.5",
|
||||||
|
assistant_stop_suffix: "",
|
||||||
|
tool_call_parser: ParserSelection::Auto,
|
||||||
|
reasoning_parser: ParserSelection::Auto,
|
||||||
|
thinking_behavior: ThinkingBehavior::Toggleable { default: true },
|
||||||
|
json_fmt: compact_json_fmt(),
|
||||||
|
sort_json_keys: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// GLM-4.7 XML-like argument format with `<think>` reasoning tags.
|
/// GLM-4.7 XML-like argument format with `<think>` reasoning tags.
|
||||||
fn glm47() -> Self {
|
fn glm47() -> Self {
|
||||||
Self {
|
Self {
|
||||||
@@ -209,6 +235,19 @@ impl RoundtripCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Nemotron V3 with `<think>` / `</think>` reasoning tags.
|
||||||
|
fn nemotron_v3() -> Self {
|
||||||
|
Self {
|
||||||
|
model_id: "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16",
|
||||||
|
assistant_stop_suffix: "<|im_end|>\n",
|
||||||
|
tool_call_parser: ParserSelection::Auto,
|
||||||
|
reasoning_parser: ParserSelection::Auto,
|
||||||
|
thinking_behavior: ThinkingBehavior::Always { value: true },
|
||||||
|
json_fmt: compact_json_fmt(),
|
||||||
|
sort_json_keys: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// GPT-OSS Harmony token-id renderer and native Harmony output processor.
|
/// GPT-OSS Harmony token-id renderer and native Harmony output processor.
|
||||||
fn gpt_oss() -> Self {
|
fn gpt_oss() -> Self {
|
||||||
Self {
|
Self {
|
||||||
@@ -247,11 +286,14 @@ roundtrip_tests! {
|
|||||||
qwen3 => [reasoning_and_content, tool_call_mix],
|
qwen3 => [reasoning_and_content, tool_call_mix],
|
||||||
qwen35 => [reasoning_and_content, tool_call_mix],
|
qwen35 => [reasoning_and_content, tool_call_mix],
|
||||||
minimax_m25 => [reasoning_and_content, tool_call_mix],
|
minimax_m25 => [reasoning_and_content, tool_call_mix],
|
||||||
|
minimax_m3 => [reasoning_and_content, tool_call_mix],
|
||||||
deepseek_v4 => [reasoning_and_content, tool_call_mix],
|
deepseek_v4 => [reasoning_and_content, tool_call_mix],
|
||||||
deepseek_v32 => [tool_call_mix],
|
deepseek_v32 => [tool_call_mix],
|
||||||
|
glm45 => [reasoning_and_content, tool_call_mix],
|
||||||
glm47 => [reasoning_and_content, tool_call_mix],
|
glm47 => [reasoning_and_content, tool_call_mix],
|
||||||
seed_oss => [reasoning_and_content],
|
seed_oss => [reasoning_and_content],
|
||||||
step3p5 => [reasoning_and_content],
|
step3p5 => [reasoning_and_content],
|
||||||
|
nemotron_v3 => [reasoning_and_content],
|
||||||
gemma4 => [tool_call_mix], // Gemma4 strips reasoning in history if there's no tool call
|
gemma4 => [tool_call_mix], // Gemma4 strips reasoning in history if there's no tool call
|
||||||
kimi_k25 => [tool_call_mix], // Kimi K2.5 strips reasoning in history
|
kimi_k25 => [tool_call_mix], // Kimi K2.5 strips reasoning in history
|
||||||
gpt_oss => [tool_call_mix], // Harmony strips reasoning in history if there's no tool call
|
gpt_oss => [tool_call_mix], // Harmony strips reasoning in history if there's no tool call
|
||||||
|
|||||||
Reference in New Issue
Block a user