View source: R/gemma_chat_template.R
| smart_chat_template | R Documentation |
Automatically detects the model type and applies the appropriate chat template. For Gemma models, uses the Gemma-specific format. For other models, falls back to 'apply_chat_template'.
smart_chat_template(model, messages, template = NULL,
add_assistant = TRUE)
model |
A model object created with model_load |
messages |
A list of message objects |
template |
Custom template (passed to apply_chat_template if not Gemma) |
add_assistant |
Whether to add assistant turn prefix |
Formatted chat template string
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.