{"record":{"id":"e9f4ec628de78a9e","repo":"chroma-core/chroma","slug":"embedding-function-must-be-a-callable-sparseembedd","errorCode":null,"errorMessage":"embedding_function must be a callable SparseEmbeddingFunction or None","messagePattern":"embedding_function must be a callable SparseEmbeddingFunction or None","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/types.py","lineNumber":1792,"sourceCode":"        if v.startswith(\"#\") and v != \"#document\":\n            raise ValueError(\n                \"source_key cannot begin with '#'. \"\n                \"The only valid key starting with '#' is Key.DOCUMENT or '#document'.\"\n            )\n\n        return v  # type: ignore[no-any-return]\n\n    @field_validator(\"embedding_function\", mode=\"before\")\n    @classmethod\n    def validate_embedding_function_field(cls, v: Any) -> Any:\n        # Validate sparse vector function for sparse vector index\n        if v is None:\n            return v\n        if callable(v):\n            # Use the sparse vector function validation\n            validate_sparse_embedding_function(v)\n            return v\n        raise ValueError(\n            \"embedding_function must be a callable SparseEmbeddingFunction or None\"\n        )\n\n\nclass StringInvertedIndexConfig(BaseModel):\n    \"\"\"Configuration for string inverted index.\"\"\"\n\n    model_config = {\"extra\": \"forbid\"}\n\n    pass\n\n\nclass IntInvertedIndexConfig(BaseModel):\n    \"\"\"Configuration for integer inverted index.\"\"\"\n\n    model_config = {\"extra\": \"forbid\"}\n\n    pass","sourceCodeStart":1774,"sourceCodeEnd":1810,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/types.py#L1774-L1810","documentation":"Error \"embedding_function must be a callable SparseEmbeddingFunction or None\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/api/types.py:1792 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"}