{"record":{"id":"4b831e7a93935525","repo":"Tencent/WeKnora","slug":"audio-transcription-model-is-not-configured","errorCode":null,"errorMessage":"audio transcription model is not configured","messagePattern":"audio transcription model is not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/temporary_document.go","lineNumber":373,"sourceCode":"\tdefer file.Close()\n\tdata, err := io.ReadAll(io.LimitReader(file, secutils.GetMaxFileSizeMB()*1024*1024+1))\n\tif err != nil {\n\t\treturn \"\", nil, nil, fmt.Errorf(\"read source file: %w\", err)\n\t}\n\text := document.FileType\n\tvar options types.TemporaryDocumentCreateOptions\n\t_ = json.Unmarshal(document.ProcessingOptions, &options)\n\tif options.ParserEngine == \"\" || options.ParserEngine == \"auto\" {\n\t\tif tenant, ok := ctx.Value(types.TenantInfoContextKey).(*types.Tenant); ok && tenant != nil {\n\t\t\toptions.ParserEngine = tenant.ParserEngineConfig.ResolveChatParserEngine(ext)\n\t\t}\n\t}\n\tif _, ok := temporaryTextExtensions[ext]; ok && (options.ParserEngine == \"\" || options.ParserEngine == \"auto\") {\n\t\treturn string(data), nil, map[string]string{\"parser\": \"plain_text\"}, nil\n\t}\n\tif docparser.IsAudioFormat(ext) {\n\t\tif options.ASRModelID == \"\" {\n\t\t\treturn \"\", nil, nil, fmt.Errorf(\"audio transcription model is not configured\")\n\t\t}\n\t\tasrModel, err := s.modelService.GetASRModel(ctx, options.ASRModelID)\n\t\tif err != nil {\n\t\t\treturn \"\", nil, nil, fmt.Errorf(\"load ASR model: %w\", err)\n\t\t}\n\t\tresult, err := asrModel.Transcribe(ctx, data, document.FileName)\n\t\tif err != nil {\n\t\t\treturn \"\", nil, nil, fmt.Errorf(\"transcribe audio: %w\", err)\n\t\t}\n\t\treturn result.Text, nil, map[string]string{\"parser\": \"asr\"}, nil\n\t}\n\n\tparserEngine := strings.TrimSpace(options.ParserEngine)\n\tif parserEngine == \"auto\" {\n\t\tparserEngine = \"\"\n\t}\n\trequest := &types.ReadRequest{\n\t\tFileContent: data, FileName: document.FileName, FileType: strings.TrimPrefix(ext, \".\"),","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/temporary_document.go#L355-L391","documentation":"Temporary document parsing in temporaryDocumentService.parse rejects audio files when no ASR (automatic speech recognition) model was selected. If the file extension is a known audio format (docparser.IsAudioFormat) but options.ASRModelID is empty, parsing cannot proceed, so it aborts with this error before any model lookup.","triggerScenarios":"Uploading a temporary document with an audio extension (mp3, wav, m4a, etc.) via Process where ParserEngine is empty or \"auto\" and options.ASRModelID was not set by the caller.","commonSituations":"Frontend uploads an audio attachment but never picks a transcription model; default ASR model not configured at tenant/system level; API client omits asr_model_id in the upload request.","solutions":["Pass a valid ASRModelID in the processing options when uploading audio files","Configure a tenant/system default ASR model so callers do not need to set it explicitly","Convert the audio to a supported text format before upload if transcription is not desired","Return a clearer client-side message prompting the user to select a transcription model"],"exampleFix":"// before\nsvc.Process(ctx, req, types.ParseOptions{ParserEngine: \"auto\"})\n// after\nsvc.Process(ctx, req, types.ParseOptions{ParserEngine: \"auto\", ASRModelID: asrModelID})","handlingStrategy":"validation","validationCode":"if isAudioExt(filepath.Ext(fileName)) && opts.ASRModelID == \"\" {\n    return errors.New(\"audio files require a configured ASR model\")\n}","typeGuard":null,"tryCatchPattern":"var missingCfgErr = errors.New(\"audio transcription model is not configured\")\nif err := process(); err != nil {\n    if strings.Contains(err.Error(), \"transcription model is not configured\") {\n        // prompt user to select an ASR model\n    }\n}","preventionTips":["Always set ASRModelID when uploading audio extensions","Configure a tenant-level default ASR model","Validate file extension vs available config client-side before upload"],"tags":["audio","asr","missing-config","validation"],"backgroundTag":"missing-required-config","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}