MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / validate_unique_batch_ids

Function validate_unique_batch_ids

app/workflow/workflow.cpp:230–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230bool is_text_batch_path(const std::filesystem::path & path) {
231 const auto ext = lowercase_extension(path);
232 return ext == ".txt" || ext == ".md" || ext == ".json";
233}
234
235void validate_unique_batch_ids(
236 const std::vector<std::unordered_map<std::string, std::string>> & items,
237 const std::string & step_id) {
238 std::unordered_set<std::string> ids;
239 for (const auto & item : items) {
240 const auto it = item.find("id");
241 if (it == item.end()) {
242 throw std::runtime_error("workflow batch item missing id: " + step_id);
243 }
244 if (!ids.insert(it->second).second) {
245 throw std::runtime_error("workflow batch item id collision in " + step_id + ": " + it->second);
246 }

Callers 1

run_batch_inputs_stepFunction · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected