{"record":{"id":"c454680a3565c1b7","repo":"Mintplex-Labs/anything-llm","slug":"no-base-url-was-set","errorCode":null,"errorMessage":"No base URL was set.","messagePattern":"No base URL was set\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"collector/utils/WhisperProviders/GenericOpenAiWhisper.js","lineNumber":7,"sourceCode":"const fs = require(\"fs\");\n\nclass GenericOpenAiWhisper {\n  constructor({ options }) {\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    if (!options.WhisperGenericOpenAiBaseUrl)\n      throw new Error(\"No base URL was set.\");\n\n    this.openai = new OpenAIApi({\n      baseURL: options.WhisperGenericOpenAiBaseUrl,\n      apiKey: options.WhisperGenericOpenAiApiKey || null,\n    });\n    this.model = options.WhisperGenericOpenAiModel || \"whisper-small\";\n    this.temperature = 0;\n    this.#log(\"Initialized.\");\n  }\n\n  #log(text, ...args) {\n    console.log(`\\x1b[32m[GenericOpenAiWhisper]\\x1b[0m ${text}`, ...args);\n  }\n\n  async processFile(fullFilePath) {\n    return await this.openai.audio.transcriptions\n      .create({\n        file: fs.createReadStream(fullFilePath),","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/collector/utils/WhisperProviders/GenericOpenAiWhisper.js#L1-L25","documentation":"Thrown synchronously by the GenericOpenAiWhisper constructor in collector/utils/WhisperProviders/GenericOpenAiWhisper.js:7 when options.WhisperGenericOpenAiBaseUrl is falsy. This provider is for an OpenAI-compatible Whisper endpoint, so without a base URL the OpenAI client cannot be pointed at the custom host. Constructing the class anywhere (transcription pipeline bootstrap) will throw and bubble up to the caller.","triggerScenarios":"Instantiating new GenericOpenAiWhisper({ options }) when the SystemPrompt/LLM preference set has WhisperProvider=\"GenericOpenAiWhisper\" but WhisperGenericOpenAiBaseUrl is empty, undefined, or whitespace in the saved options payload.","commonSituations":"User selected the Generic OpenAI Whisper provider in settings but did not fill the base URL field; env var feeding the option was not set in the container; option key typo in a custom integration; migration reset the field.","solutions":["Set WhisperGenericOpenAiBaseUrl on the options object (e.g. \"https://local-whisper.example.com/v1\").","If using the AnythingLLM UI, re-open the transcription settings and fill the Base URL field for the Generic OpenAI-compatible provider.","If setting via env, confirm the variable is exported in the collector process and mapped into options.","If you actually meant to use OpenAI-hosted Whisper, switch the provider to OpenAiWhisper instead."],"exampleFix":"// before\nnew GenericOpenAiWhisper({ options: { WhisperGenericOpenAiBaseUrl: \"\" } });\n\n// after\nnew GenericOpenAiWhisper({\n  options: {\n    WhisperGenericOpenAiBaseUrl: \"https://whisper.local/v1\",\n    WhisperGenericOpenAiApiKey: process.env.WHISPER_KEY,\n    WhisperGenericOpenAiModel: \"whisper-small\",\n  },\n});","handlingStrategy":"validation","validationCode":"function canBuildGenericWhisper(options) {\n  return !!(options && typeof options.WhisperGenericOpenAiBaseUrl === \"string\"\n    && options.WhisperGenericOpenAiBaseUrl.trim().length > 0);\n}\nif (!canBuildGenericWhisper(options)) {\n  throw new Error(\"GenericOpenAiWhisper requires WhisperGenericOpenAiBaseUrl in options\");\n}\nnew GenericOpenAiWhisper({ options });","typeGuard":"/** @param {unknown} o */\nfunction isGenericWhisperConfig(o) {\n  return o != null && typeof o === \"object\"\n    && typeof o.WhisperGenericOpenAiBaseUrl === \"string\"\n    && o.WhisperGenericOpenAiBaseUrl.trim().length > 0;\n}","tryCatchPattern":"// constructor throws synchronously — wrap the instantiation, not just the call site\nlet provider;\ntry {\n  provider = new GenericOpenAiWhisper({ options });\n} catch (e) {\n  if (/No base URL was set/.test(e.message)) {\n    return surfaceConfigError(\"Transcription base URL is missing in settings.\");\n  }\n  throw e;\n}","preventionTips":["Validate the options object before constructing any Whisper provider — constructors throw on missing config.","Map env vars (e.g. WHISPER_BASE_URL) into options explicitly so missing env surfaces as your own error.","If you only have an OpenAI key, use OpenAiWhisper; if you have a custom endpoint, use GenericOpenAiWhisper with a base URL."],"tags":["config","whisper","openai","validation","audio"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}