| 544 | throw std::runtime_error("workflow model step requested text_out but produced no text: " + id); |
| 545 | } |
| 546 | if (!path.parent_path().empty()) { |
| 547 | std::filesystem::create_directories(path.parent_path()); |
| 548 | } |
| 549 | std::ofstream out(path); |
| 550 | out << result.text_output->text << "\n"; |
| 551 | std::cout << "text_out=" << path.string() << "\n"; |
| 552 | } |
| 553 | |
| 554 | void write_words_result( |
| 555 | const engine::runtime::TaskResult & result, |
| 556 | const std::filesystem::path & path, |
| 557 | const std::string & id) { |
| 558 | if (result.word_timestamps.empty()) { |
| 559 | throw std::runtime_error("workflow model step requested words_out but produced no word timestamps: " + id); |
| 560 | } |
| 561 | if (!path.parent_path().empty()) { |
| 562 | std::filesystem::create_directories(path.parent_path()); |
no test coverage detected