#![allow(missing_docs, dead_code)]
pub(crate) static BYTE_DECODER: &[(char, u8)] = &[
('!', 33),
('"', 34),
('#', 35),
('$', 36),
('%', 37),
('&', 38),
('\'', 39),
('(', 40),
(')', 41),
('*', 42),
('+', 43),
(',', 44),
('-', 45),
('.', 46),
('/', 47),
('0', 48),
('1', 49),
('2', 50),
('3', 51),
('4', 52),
('5', 53),
('6', 54),
('7', 55),
('8', 56),
('9', 57),
(':', 58),
(';', 59),
('<', 60),
('=', 61),
('>', 62),
('?', 63),
('@', 64),
('A', 65),
('B', 66),
('C', 67),
('D', 68),
('E', 69),
('F', 70),
('G', 71),
('H', 72),
('I', 73),
('J', 74),
('K', 75),
('L', 76),
('M', 77),
('N', 78),
('O', 79),
('P', 80),
('Q', 81),
('R', 82),
('S', 83),
('T', 84),
('U', 85),
('V', 86),
('W', 87),
('X', 88),
('Y', 89),
('Z', 90),
('[', 91),
('\\', 92),
(']', 93),
('^', 94),
('_', 95),
('`', 96),
('a', 97),
('b', 98),
('c', 99),
('d', 100),
('e', 101),
('f', 102),
('g', 103),
('h', 104),
('i', 105),
('j', 106),
('k', 107),
('l', 108),
('m', 109),
('n', 110),
('o', 111),
('p', 112),
('q', 113),
('r', 114),
('s', 115),
('t', 116),
('u', 117),
('v', 118),
('w', 119),
('x', 120),
('y', 121),
('z', 122),
('{', 123),
('|', 124),
('}', 125),
('~', 126),
('¡', 161),
('¢', 162),
('£', 163),
('¤', 164),
('¥', 165),
('¦', 166),
('§', 167),
('¨', 168),
('©', 169),
('ª', 170),
('«', 171),
('¬', 172),
('®', 174),
('¯', 175),
('°', 176),
('±', 177),
('²', 178),
('³', 179),
('´', 180),
('µ', 181),
('¶', 182),
('·', 183),
('¸', 184),
('¹', 185),
('º', 186),
('»', 187),
('¼', 188),
('½', 189),
('¾', 190),
('¿', 191),
('À', 192),
('Á', 193),
('Â', 194),
('Ã', 195),
('Ä', 196),
('Å', 197),
('Æ', 198),
('Ç', 199),
('È', 200),
('É', 201),
('Ê', 202),
('Ë', 203),
('Ì', 204),
('Í', 205),
('Î', 206),
('Ï', 207),
('Ð', 208),
('Ñ', 209),
('Ò', 210),
('Ó', 211),
('Ô', 212),
('Õ', 213),
('Ö', 214),
('×', 215),
('Ø', 216),
('Ù', 217),
('Ú', 218),
('Û', 219),
('Ü', 220),
('Ý', 221),
('Þ', 222),
('ß', 223),
('à', 224),
('á', 225),
('â', 226),
('ã', 227),
('ä', 228),
('å', 229),
('æ', 230),
('ç', 231),
('è', 232),
('é', 233),
('ê', 234),
('ë', 235),
('ì', 236),
('í', 237),
('î', 238),
('ï', 239),
('ð', 240),
('ñ', 241),
('ò', 242),
('ó', 243),
('ô', 244),
('õ', 245),
('ö', 246),
('÷', 247),
('ø', 248),
('ù', 249),
('ú', 250),
('û', 251),
('ü', 252),
('ý', 253),
('þ', 254),
('ÿ', 255),
('Ā', 0),
('ā', 1),
('Ă', 2),
('ă', 3),
('Ą', 4),
('ą', 5),
('Ć', 6),
('ć', 7),
('Ĉ', 8),
('ĉ', 9),
('Ċ', 10),
('ċ', 11),
('Č', 12),
('č', 13),
('Ď', 14),
('ď', 15),
('Đ', 16),
('đ', 17),
('Ē', 18),
('ē', 19),
('Ĕ', 20),
('ĕ', 21),
('Ė', 22),
('ė', 23),
('Ę', 24),
('ę', 25),
('Ě', 26),
('ě', 27),
('Ĝ', 28),
('ĝ', 29),
('Ğ', 30),
('ğ', 31),
('Ġ', 32),
('ġ', 127),
('Ģ', 128),
('ģ', 129),
('Ĥ', 130),
('ĥ', 131),
('Ħ', 132),
('ħ', 133),
('Ĩ', 134),
('ĩ', 135),
('Ī', 136),
('ī', 137),
('Ĭ', 138),
('ĭ', 139),
('Į', 140),
('į', 141),
('İ', 142),
('ı', 143),
('IJ', 144),
('ij', 145),
('Ĵ', 146),
('ĵ', 147),
('Ķ', 148),
('ķ', 149),
('ĸ', 150),
('Ĺ', 151),
('ĺ', 152),
('Ļ', 153),
('ļ', 154),
('Ľ', 155),
('ľ', 156),
('Ŀ', 157),
('ŀ', 158),
('Ł', 159),
('ł', 160),
('Ń', 173),
];
pub(crate) static BPE_SPACE_MATCHES: &[&str] =
&[".", "?", "!", ",", "n't", "'m", "'s", "'ve", "'re"];
pub(crate) struct ToolParserMarkers {
pub name: &'static str,
pub start: &'static str,
pub end: &'static str,
}
pub(crate) struct ToolParserSelect {
pub name: &'static str,
pub all: &'static [&'static str],
pub any_of: &'static [&'static str],
}
pub(crate) static TOOL_PARSER_MARKERS: &[ToolParserMarkers] = &[
ToolParserMarkers {
name: "minimax_m2",
start: "<minimax:tool_call>",
end: "</minimax:tool_call>",
},
ToolParserMarkers {
name: "gemma4",
start: "<|tool_call>",
end: "<tool_call|>",
},
ToolParserMarkers {
name: "function_gemma",
start: "<start_function_call>",
end: "<end_function_call>",
},
ToolParserMarkers {
name: "longcat",
start: "<longcat_tool_call>",
end: "</longcat_tool_call>",
},
ToolParserMarkers {
name: "glm47",
start: "<tool_call>",
end: "</tool_call>",
},
ToolParserMarkers {
name: "pythonic",
start: "<|tool_call_start|>",
end: "<|tool_call_end|>",
},
ToolParserMarkers {
name: "qwen3_coder",
start: "<tool_call>",
end: "</tool_call>",
},
ToolParserMarkers {
name: "kimi_k2",
start: "<|tool_calls_section_begin|>",
end: "<|tool_calls_section_end|>",
},
ToolParserMarkers {
name: "mistral",
start: "[TOOL_CALLS]",
end: "",
},
ToolParserMarkers {
name: "json_tools",
start: "<tool_call>",
end: "</tool_call>",
},
];
pub(crate) static TOOL_PARSER_SELECT: &[ToolParserSelect] = &[
ToolParserSelect {
name: "minimax_m2",
all: &["<minimax:tool_call>"],
any_of: &[],
},
ToolParserSelect {
name: "gemma4",
all: &["<|tool_call>", "<tool_call|>"],
any_of: &[],
},
ToolParserSelect {
name: "function_gemma",
all: &["<start_function_call>"],
any_of: &[],
},
ToolParserSelect {
name: "longcat",
all: &["<longcat_tool_call>"],
any_of: &[],
},
ToolParserSelect {
name: "glm47",
all: &["<arg_key>"],
any_of: &[],
},
ToolParserSelect {
name: "pythonic",
all: &["<|tool_list_start|>"],
any_of: &[],
},
ToolParserSelect {
name: "qwen3_coder",
all: &[],
any_of: &["<tool_call>\\n<function=", "<tool_call>\n<function="],
},
ToolParserSelect {
name: "kimi_k2",
all: &["<|tool_calls_section_begin|>"],
any_of: &[],
},
ToolParserSelect {
name: "mistral",
all: &["[TOOL_CALLS]"],
any_of: &[],
},
ToolParserSelect {
name: "json_tools",
all: &["<tool_call>", "tool_call.name"],
any_of: &[],
},
];
pub(crate) static DEEPSEEK_V32_TEMPLATE: &str = r#"## Tools
You have access to a set of tools you can use to answer the user's question.
You can invoke functions by writing a "<{dsml}function_calls>" block like the following as part of your reply to the user:
<{dsml}function_calls>
<{dsml}invoke name="$FUNCTION_NAME">
<{dsml}parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</{dsml}parameter>
...
</{dsml}invoke>
<{dsml}invoke name="$FUNCTION_NAME2">
...
</{dsml}invoke>
</{dsml}function_calls>
String and scalar parameters should be specified as is without any escaping or quotes, while lists and objects should use JSON format. The "string" attribute should be set to "true" for string type parameters and "false" for other types (numbers, booleans, arrays, objects).
If the thinking_mode is enabled, then after function results you should strongly consider outputting a thinking block. Here is an example:
<{dsml}function_calls>
...
</{dsml}function_calls>
<function_results>
...
</function_results>
{think_start}...thinking about results{think_end}
Here are the functions available in JSONSchema format:
<functions>
{tool_schemas}
</functions>
"#;