MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / option_string_list

Function option_string_list

src/models/ace_step/request_parser.cpp:23–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace {
22
23std::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
41std::vector<float> option_f32_list(const runtime::TaskRequest &request, std::string_view key) {
42 const auto value = runtime::find_option(request.options, {key});

Callers 1

ace_step_parse_requestFunction · 0.85

Calls 4

find_optionFunction · 0.85
parseFunction · 0.85
is_nullMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected