| 116 | } |
| 117 | |
| 118 | void set_process_env(const char * key, const std::string & value) { |
| 119 | #if defined(_WIN32) |
| 120 | if (_putenv_s(key, value.c_str()) != 0) { |
| 121 | throw std::runtime_error("failed to set environment variable: " + std::string(key)); |
| 122 | } |
| 123 | #else |
| 124 | if (setenv(key, value.c_str(), 1) != 0) { |
| 125 | throw std::runtime_error("failed to set environment variable: " + std::string(key)); |
| 126 | } |
| 127 | #endif |
| 128 | } |
| 129 | |
| 130 | engine::runtime::TaskRequest make_request( |
| 131 | const std::string & text, |