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

Method build_speech_request

app/server/runtime.cpp:515–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513 return error_response(403, "UI model installation is disabled", "forbidden");
514 }
515 const auto package_id = parse_ui_model_id(body_text);
516 std::lock_guard<std::mutex> lock(model_installer_mutex_);
517 if (!model_installer_) {
518 return error_response(403, "UI model installation is disabled", "forbidden");
519 }
520 return ui_model_install_stop_response(package_id, *model_installer_);
521}
522
523HttpResponse ServerState::handle_model_clean_partial(const std::string & body_text) {
524 if (!config_.ui_management) {
525 return error_response(403, "UI model cleanup is disabled", "forbidden");
526 }
527 const auto package_id = parse_ui_model_id(body_text);
528 std::lock_guard<std::mutex> lock(model_installer_mutex_);
529 if (!model_installer_) {
530 return error_response(403, "UI model cleanup is disabled", "forbidden");
531 }
532 return ui_model_clean_partial_response(package_id, *model_installer_);
533}
534
535HttpResponse ServerState::handle_model_install_status(const HttpRequest & request) const {
536 if (!config_.ui_management) {
537 return error_response(403, "UI model installation is disabled", "forbidden");
538 }
539 std::lock_guard<std::mutex> lock(model_installer_mutex_);
540 if (!model_installer_) {
541 return error_response(403, "UI model installation is disabled", "forbidden");
542 }
543 return ui_model_install_status_response(request, *model_installer_);
544}
545
546HttpResponse ServerState::handle_model_package_sizes() {
547 if (!config_.ui_management) {
548 return error_response(403, "UI model installation is disabled", "forbidden");
549 }
550 std::lock_guard<std::mutex> lock(model_installer_mutex_);
551 if (!model_installer_) {
552 return error_response(403, "UI model installation is disabled", "forbidden");
553 }
554 return ui_model_package_sizes_response(*model_installer_);
555}
556
557HttpResponse ServerState::handle_models_root_get() const {
558 if (!config_.ui_management) {
559 return error_response(403, "UI model management is disabled", "forbidden");
560 }
561 std::lock_guard<std::mutex> lock(model_installer_mutex_);
562 if (!model_installer_) {
563 return error_response(403, "UI model management is disabled", "forbidden");
564 }
565 return ui_models_root_response(models_root_, default_models_root_);
566}
567
568HttpResponse ServerState::handle_models_root_set(const std::string & body_text) {
569 if (!config_.ui_management) {
570 return error_response(403, "UI model management is disabled", "forbidden");
571 }
572 const auto body = engine::io::json::parse(body_text);

Callers

nothing calls this directly

Calls 8

require_stringFunction · 0.85
add_option_from_jsonFunction · 0.85
options_from_objectFunction · 0.70
resolve_pathFunction · 0.70
optional_stringFunction · 0.50
read_audio_bufferFunction · 0.50
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected