{"record":{"id":"0d3f61daf742bc73","repo":"mudler/LocalAI","slug":"qwen3-tts-cpp-error-text-is-required-n","errorCode":null,"errorMessage":"[qwen3-tts-cpp] ERROR: text is required\\n","messagePattern":"\\[qwen3-tts-cpp\\] ERROR: text is required\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp","lineNumber":109,"sourceCode":"    if (repetition_penalty > 0.0f)\n        tp->repetition_penalty = repetition_penalty;\n    if (max_new_tokens > 0)\n        tp->max_new_tokens = max_new_tokens;\n}\n\nfloat *qt3_tts(const char *text, const char *lang, const char *instruct,\n               const char *speaker, const float *ref_samples, int ref_n,\n               const char *ref_text, long long seed, float temperature,\n               int top_k, float top_p, float repetition_penalty,\n               int max_new_tokens, int *out_n) {\n    if (out_n)\n        *out_n = 0;\n    if (!g_ctx) {\n        fprintf(stderr, \"[qwen3-tts-cpp] ERROR: model not loaded\\n\");\n        return nullptr;\n    }\n    if (!text || text[0] == '\\0') {\n        fprintf(stderr, \"[qwen3-tts-cpp] ERROR: text is required\\n\");\n        return nullptr;\n    }\n    qt_tts_params tp;\n    fill_params(&tp, text, lang, instruct, speaker, ref_samples, ref_n,\n                ref_text, seed, temperature, top_k, top_p, repetition_penalty,\n                max_new_tokens);\n\n    qt_audio out = {0};\n    enum qt_status rc = qt_synthesize(g_ctx, &tp, &out);\n    if (rc != QT_STATUS_OK || out.n_samples <= 0 || !out.samples) {\n        fprintf(stderr, \"[qwen3-tts-cpp] ERROR: synthesize failed (rc=%d): %s\\n\",\n                (int)rc, qt_last_error());\n        qt_audio_free(&out);\n        return nullptr;\n    }\n\n    // Copy into a plain malloc buffer the Go side frees via qt3_pcm_free.\n    size_t bytes = (size_t)out.n_samples * sizeof(float);","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp#L91-L127","documentation":"The qwen3-tts-cpp backend received a synthesis request with an empty text field. Guard: validate the request text is non-empty before calling into the shim; trim whitespace and reject empty payloads at the gRPC handler.","triggerScenarios":"Thrown at backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty text field in the TTS request.","Ensure the client sets the text parameter before calling the endpoint."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}