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

Method handle_speech

app/server/runtime.cpp:597–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595 "cannot change the models folder while a package download is running",
596 "model_install_active");
597 }
598
599 std::error_code error;
600 if (std::filesystem::exists(requested, error) && !std::filesystem::is_directory(requested, error)) {
601 return error_response(400, "models folder path is not a directory: " + requested.string(), "invalid_request_error");
602 }
603 std::filesystem::create_directories(requested, error);
604 if (error) {
605 return error_response(
606 400,
607 "could not create models folder '" + requested.string() + "': " + error.message(),
608 "invalid_request_error");
609 }
610
611 models_root_ = requested;
612 model_installer_ = std::make_unique<ModelInstaller>(repository_root_, models_root_);
613 std::cerr << "native WebUI model root changed to: " << models_root_ << "\n";
614 return json_response(
615 "{\"models_root\":" + json_quote(models_root_.string()) +
616 ",\"default_models_root\":" + json_quote(default_models_root_.string()) +
617 ",\"is_default\":" + (models_root_ == default_models_root_ ? "true" : "false") + "}");
618}
619

Callers

nothing calls this directly

Calls 11

parseFunction · 0.85
encode_pcm16_wavFunction · 0.85
json_responseFunction · 0.85
base64_encodeFunction · 0.85
timing_jsonFunction · 0.85
timing_headersFunction · 0.85
json_quoteFunction · 0.70
optional_stringFunction · 0.50
stringFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected