| 709 | } |
| 710 | |
| 711 | static void foreach_function(const json & tools, const std::function<void(const json &)> & fn) { |
| 712 | for (const auto & tool : tools) { |
| 713 | if (!tool.contains("type") || tool.at("type") != "function" || !tool.contains("function")) { |
| 714 | LOG_INF("Skipping tool without function: %s", tool.dump(2).c_str()); |
| 715 | continue; |
| 716 | } |
| 717 | fn(tool); |
| 718 | } |
| 719 | } |
| 720 | |
| 721 | static std::string apply( |
| 722 | const common_chat_template & tmpl, |
no test coverage detected