Reset tools when empty string provided

This commit is contained in:
Mason M 2025-02-04 13:21:28 -04:00
parent cd16957f7d
commit 4e8beb0c53

View file

@ -1775,6 +1775,10 @@ common_params_tools::common_params_tools(std::string tools, std::string choice)
} }
void common_params_tools::tools(std::string tools) { void common_params_tools::tools(std::string tools) {
if (tools.empty()) {
tools_.reset();
return;
}
try { try {
tools_ = std::make_shared<json>(json::parse(tools)); tools_ = std::make_shared<json>(json::parse(tools));
if (! tools_->is_array()) { if (! tools_->is_array()) {