chatApplyTemplate

Apply a Jinja chat template to a list of messages.

tmpl may be null to use an empty string (the model's embedded template is selected elsewhere). Set addAss = true to append the assistant-turn prefix so the model continues from there.

Returns the number of bytes written to buf. If the return value exceeds buf.length, reallocate and call again.

@trusted @nogc nothrow
int
chatApplyTemplate
(
const(char)* tmpl
,
scope const(llama_chat_message)[] chat
,
bool addAss
,
scope char[] buf
)

Meta