| 529 | context.values[id + ".text"] = result.text_output->text; |
| 530 | } |
| 531 | if (text_out.has_value()) { |
| 532 | context.values[id + ".text_path"] = text_out->string(); |
| 533 | } |
| 534 | if (words_out.has_value()) { |
| 535 | context.values[id + ".words_path"] = words_out->string(); |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | void write_text_result( |
| 540 | const engine::runtime::TaskResult & result, |
| 541 | const std::filesystem::path & path, |
| 542 | const std::string & id) { |
| 543 | if (!result.text_output.has_value()) { |
| 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()); |
no test coverage detected