| 724 | } |
| 725 | |
| 726 | static void foreach_function(const json & tools, const std::function<void(const json &)> & fn) { |
| 727 | for (const auto & tool : tools) { |
| 728 | if (!tool.contains("type") || tool.at("type") != "function" || !tool.contains("function")) { |
| 729 | LOG_INF("Skipping tool without function: %s", tool.dump(2).c_str()); |
| 730 | continue; |
| 731 | } |
| 732 | fn(tool); |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | static void foreach_parameter(const json & function, |
| 737 | const std::function<void(const std::string &, const json &, bool)> & fn) { |
no test coverage detected