| 200 | } |
| 201 | |
| 202 | common_chat_params format_chat() { |
| 203 | auto meta = ctx_server.get_meta(); |
| 204 | auto & chat_params = meta.chat_params; |
| 205 | |
| 206 | auto caps = common_chat_templates_get_caps(chat_params.tmpls.get()); |
| 207 | |
| 208 | common_chat_templates_inputs inputs; |
| 209 | inputs.messages = common_chat_msgs_parse_oaicompat(messages); |
| 210 | inputs.tools = {}; // TODO |
| 211 | inputs.tool_choice = COMMON_CHAT_TOOL_CHOICE_NONE; |
| 212 | inputs.json_schema = ""; // TODO |
| 213 | inputs.grammar = ""; // TODO |
| 214 | inputs.use_jinja = chat_params.use_jinja; |
| 215 | inputs.parallel_tool_calls = caps["supports_parallel_tool_calls"]; |
| 216 | inputs.add_generation_prompt = true; |
| 217 | inputs.reasoning_format = COMMON_REASONING_FORMAT_DEEPSEEK; |
| 218 | inputs.force_pure_content = chat_params.force_pure_content; |
| 219 | inputs.enable_thinking = chat_params.enable_thinking ? common_chat_templates_support_enable_thinking(chat_params.tmpls.get()) : false; |
| 220 | |
| 221 | // Apply chat template to the list of messages |
| 222 | return common_chat_templates_apply(chat_params.tmpls.get(), inputs); |
| 223 | } |
| 224 | }; |
| 225 | |
| 226 | // TODO?: Make this reusable, enums, docs |
nothing calls this directly
no test coverage detected