12 if(index_.count(tool.
name) != 0)
14 tools_[index_[tool.
name]] = std::move(tool);
17 index_[tool.
name] = tools_.size();
18 tools_.push_back(std::move(tool));
23 auto it = index_.find(
name);
24 if(it == index_.end())
28 return &tools_[it->second];
38 std::string out =
"[";
39 for(
size_t i = 0; i < tools_.size(); ++i)
41 const auto& tool = tools_[i];
46 out += fmt::format(R
"({{"name":{},"description":{},"inputSchema":{}}})",
49 tool.input_schema_json.empty() ? R"({"type":"object","properties":{}})"
50 : tool.input_schema_json);
Hash specialization for batch_key to enable use in std::unordered_map.
auto make_json_string(const std::string &value) -> std::string