{"record":{"id":"f937b539750a7791","repo":"chroma-core/chroma","slug":"embedding-function-with-name-name-is-already-re","errorCode":null,"errorMessage":"Embedding function with name ${name} is already registered.","messagePattern":"Embedding function with name (.+?) is already registered\\.","errorType":"validation","errorClass":"ChromaValueError","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/embedding-function.ts","lineNumber":198,"sourceCode":"]);\n\n/**\n * Union type covering both dense and sparse embedding functions.\n */\nexport type AnyEmbeddingFunction = EmbeddingFunction | SparseEmbeddingFunction;\n\n/**\n * Registers an embedding function in the global registry.\n * @param name - Unique name for the embedding function\n * @param fn - Embedding function class to register\n * @throws ChromaValueError if name is already registered\n */\nexport const registerEmbeddingFunction = (\n  name: string,\n  fn: EmbeddingFunctionClass,\n) => {\n  if (knownEmbeddingFunctions.has(name)) {\n    throw new ChromaValueError(\n      `Embedding function with name ${name} is already registered.`,\n    );\n  }\n  knownEmbeddingFunctions.set(name, fn);\n};\n\n/**\n * Registers a sparse embedding function in the global registry.\n * @param name - Unique name for the sparse embedding function\n * @param fn - Sparse embedding function class to register\n * @throws ChromaValueError if name is already registered\n */\nexport const registerSparseEmbeddingFunction = (\n  name: string,\n  fn: SparseEmbeddingFunctionClass,\n) => {\n  if (knownSparseEmbeddingFunctions.has(name)) {\n    throw new ChromaValueError(","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/embedding-function.ts#L180-L216","documentation":"Error \"Embedding function with name ${name} is already registered.\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/chromadb/src/embedding-function.ts:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}