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

Callers 1

run_batch_inputs_stepFunction · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected