File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,14 @@ common_chat_templates_ptr common_chat_templates_init(
605
605
return tmpls;
606
606
}
607
607
608
+ bool common_chat_templates_get_add_bos (const struct common_chat_templates * tmpls) {
609
+ return tmpls->add_bos ;
610
+ }
611
+
612
+ bool common_chat_templates_get_add_eos (const struct common_chat_templates * tmpls) {
613
+ return tmpls->add_eos ;
614
+ }
615
+
608
616
const char * common_chat_format_name (common_chat_format format) {
609
617
switch (format) {
610
618
case COMMON_CHAT_FORMAT_CONTENT_ONLY: return " Content-only" ;
Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ common_chat_templates_ptr common_chat_templates_init(
170
170
171
171
bool common_chat_templates_was_explicit (const struct common_chat_templates * tmpls);
172
172
const char * common_chat_templates_source (const struct common_chat_templates * tmpls, const char * variant = nullptr );
173
+ bool common_chat_templates_get_add_bos (const struct common_chat_templates * tmpls);
174
+ bool common_chat_templates_get_add_eos (const struct common_chat_templates * tmpls);
173
175
174
176
175
177
struct common_chat_params common_chat_templates_apply (
Original file line number Diff line number Diff line change @@ -752,6 +752,8 @@ static json oaicompat_chat_params_parse(
752
752
inputs.add_generation_prompt = json_value (body, " add_generation_prompt" , true );
753
753
inputs.reasoning_format = opt.reasoning_format ;
754
754
inputs.enable_thinking = opt.enable_thinking ;
755
+ inputs.add_bos = common_chat_templates_get_add_bos (opt.tmpls );
756
+ inputs.add_eos = common_chat_templates_get_add_eos (opt.tmpls );
755
757
if (!inputs.tools .empty () && inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_NONE) {
756
758
if (body.contains (" grammar" )) {
757
759
throw std::runtime_error (" Cannot use custom grammar constraints with tools." );
You can’t perform that action at this time.
0 commit comments