| 21 | namespace { |
| 22 | |
| 23 | std::vector<std::string> option_string_list(const runtime::TaskRequest &request, std::string_view key) { |
| 24 | const auto value = runtime::find_option(request.options, {key}); |
| 25 | if (!value.has_value() || value->empty()) { |
| 26 | return {}; |
| 27 | } |
| 28 | if (value->front() == '[') { |
| 29 | const auto root = engine::io::json::parse(*value); |
| 30 | std::vector<std::string> out; |
| 31 | for (const auto & item : root.as_array()) { |
| 32 | if (!item.is_null()) { |
| 33 | out.push_back(item.as_string()); |
| 34 | } |
| 35 | } |
| 36 | return out; |
| 37 | } |
| 38 | return {*value}; |
| 39 | } |
| 40 | |
| 41 | std::vector<float> option_f32_list(const runtime::TaskRequest &request, std::string_view key) { |
| 42 | const auto value = runtime::find_option(request.options, {key}); |
no test coverage detected