| 217 | } |
| 218 | |
| 219 | engine::io::json::Value step_json( |
| 220 | const engine::runtime::TaskResult & result, |
| 221 | int request_index, |
| 222 | double wall_ms, |
| 223 | const std::filesystem::path & audio_path) { |
| 224 | if (!result.audio_output.has_value()) { |
| 225 | throw std::runtime_error("ACE-Step warmbench expected audio_output"); |
| 226 | } |
| 227 | engine::io::json::Value::Object stem{ |
| 228 | {"name", string("mix")}, |
| 229 | {"summary", audio_summary_json(*result.audio_output)}, |
| 230 | }; |
| 231 | if (!audio_path.empty()) { |
| 232 | stem.emplace("audio", string(audio_path.string())); |
| 233 | } |
| 234 | return engine::io::json::Value::make_object({ |
| 235 | {"request_index", number(static_cast<double>(request_index))}, |
| 236 | {"stems", engine::io::json::Value::make_array({engine::io::json::Value::make_object(std::move(stem))})}, |
| 237 | {"metrics", engine::io::json::Value::make_object({{"wall_ms", number(wall_ms)}})}, |
| 238 | }); |
| 239 | } |
| 240 | |
| 241 | } // namespace |
| 242 |
no test coverage detected