Skip to content

Commit 18d5a1b

Browse files
author
ochafik
committed
nits
1 parent 47be437 commit 18d5a1b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

common/chat-handler.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,14 @@ static common_chat_data common_chat_init_llama_3_1_python_tag_tool_calls(const c
352352
std::vector<std::string> tool_rules;
353353

354354
auto handle_builtin_tool = [&](const std::string & name, const json & parameters) {
355-
if (name == "wolfram_alpha") { // https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/remote/tool_runtime/wolfram_alpha/wolfram_alpha.py
355+
if (name == "wolfram_alpha") {
356+
// https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/remote/tool_runtime/wolfram_alpha/wolfram_alpha.py
356357
expect_tool_parameters(name, parameters, {"query"});
357-
} else if (name == "web_search" || name == "brave_search") { // https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/remote/tool_runtime/brave_search/brave_search.py
358+
} else if (name == "web_search" || name == "brave_search") {
359+
// https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/remote/tool_runtime/brave_search/brave_search.py
358360
expect_tool_parameters(name, parameters, {"query"});
359-
} else if (name == "python" || name == "code_interpreter") { // https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/inline/tool_runtime/code_interpreter/code_interpreter.py
361+
} else if (name == "python" || name == "code_interpreter") {
362+
// https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/inline/tool_runtime/code_interpreter/code_interpreter.py
360363
expect_tool_parameters(name, parameters, {"code"});
361364
} else {
362365
return false;
@@ -792,7 +795,7 @@ common_chat_data common_chat_init(const common_chat_template & tmpl, const struc
792795
// Firefunction v2 requires datetime and functions in the context
793796
return common_chat_init_firefunction_v2_tool_call(tmpl, params);
794797
}
795-
798+
796799
if (has_tools) {
797800
return common_chat_init_without_tools(tmpl, params);
798801
}
@@ -816,11 +819,9 @@ common_chat_data common_chat_init(const common_chat_template & tmpl, const struc
816819
if (src.find("<|tool▁calls▁begin|>") != std::string::npos) {
817820
return common_chat_init_deepseek_r1_tool_call(tmpl, params);
818821
}
819-
// if (src.find("<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>") != std::string::npos) {
820-
// TODO: Command-R-Plus
821-
// }
822822
if (src.find("[TOOL_CALLS]") != std::string::npos) {
823823
return common_chat_init_mistral_nemo_tool_call(tmpl, params);
824824
}
825825
return common_chat_init_generic_tool_call(tmpl, params);
826826
}
827+

0 commit comments

Comments
 (0)