Branch: GraniteToolCallTemplate
Signed-off-by: Gabe Goodhart <redacted>
// IBM Granite template
for (const auto & message : chat) {
std::string role(message->role);
- ss << "<|start_of_role|>" << role << "<|end_of_role|>"
- << message->content << "<|end_of_text|>\n";
+ ss << "<|start_of_role|>" << role << "<|end_of_role|>";
+ if (role == "assistant_tool_call") {
+ ss << "<|tool_call|>";
+ }
+ ss << message->content << "<|end_of_text|>\n";
}
if (add_ass) {
ss << "<|start_of_role|>assistant<|end_of_role|>\n";