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

Function emit_batch_item_result

app/workflow/file_sink.cpp:347–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345 }
346
347 if (policy.batch_manifest_out.has_value()) {
348 if (!policy.batch_manifest_out->parent_path().empty()) {
349 std::filesystem::create_directories(policy.batch_manifest_out->parent_path());
350 }
351 std::ofstream(*policy.batch_manifest_out) << batch_manifest_to_json(batch) << "\n";
352 std::cout << "batch_manifest_out=" << policy.batch_manifest_out->string() << "\n";
353 }
354}
355
356void emit_batch_item_result(
357 size_t index,
358 const AppRequestResult & item,
359 const FileOutputPolicy & policy) {
360 const std::string request_id = safe_output_name(item.id);
361 std::cout << "request_index=" << index << "\n";
362 std::cout << "request_id=" << request_id << "\n";
363 std::cout << "[TIMING] request." << request_id << ".wall_ms " << item.wall_ms << "\n";
364
365 std::optional<std::filesystem::path> audio_out;
366 std::optional<std::filesystem::path> named_out_dir;
367 std::optional<std::filesystem::path> artifact_out_dir;
368 if (policy.output_dir.has_value()) {
369 if (item.result.audio_output.has_value()) {
370 audio_out = *policy.output_dir / (request_id + ".wav");
371 }
372 if (!item.result.named_audio_outputs.empty()) {
373 named_out_dir = *policy.output_dir / request_id;
374 }
375 if (!item.result.output_artifacts.empty()) {
376 artifact_out_dir = *policy.output_dir / request_id;
377 }
378 }
379 emit_task_result(
380 item.result,

Callers 2

mainFunction · 0.85
emit_batch_resultFunction · 0.85

Calls 4

safe_output_nameFunction · 0.85
emit_task_resultFunction · 0.85
suffixed_json_pathFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected