Add common_chat_parse function for message parsing

Fixes #17771
This commit is contained in:
Sheldon Robinson 2025-12-04 18:05:59 -05:00 committed by GitHub
parent 96fe9badfc
commit ce174073ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -2596,3 +2596,14 @@ common_chat_params common_chat_templates_apply(
? common_chat_templates_apply_jinja(tmpls, inputs)
: common_chat_templates_apply_legacy(tmpls, inputs);
}
common_chat_msg common_chat_parse(
const std::string & input,
bool is_partial,
const common_chat_syntax & syntax)
{
common_chat_msg_parser parser(input, is_partial, syntax);
common_chat_parse(parser);
return parser.result();
}