{"record":{"id":"163a0a86de4593ce","repo":"chroma-core/chroma","slug":"expected-sparseembeddingfunction-call-to-have","errorCode":null,"errorMessage":"Expected SparseEmbeddingFunction.__call__ to have the following signature: {protocol_signature}, got {function_signature}\\nPlease see https://docs.trychroma.com/guides/embeddings for details of the SparseEmbeddingFunction interface.\\n","messagePattern":"Expected SparseEmbeddingFunction\\.__call__ to have the following signature: (.+?), got (.+?)\\\\nPlease see https://docs\\.trychroma\\.com/guides/embeddings for details of the SparseEmbeddingFunction interface\\.\\\\n","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/types.py","lineNumber":1580,"sourceCode":"        return\n\n    @staticmethod\n    def validate_config(config: Dict[str, Any]) -> None:\n        \"\"\"Validate a config.\"\"\"\n        return\n\n\ndef validate_sparse_embedding_function(\n    sparse_vector_function: SparseEmbeddingFunction[Embeddable],\n) -> None:\n    \"\"\"Validate that a sparse vector function conforms to the SparseEmbeddingFunction protocol.\"\"\"\n    function_signature = signature(\n        sparse_vector_function.__class__.__call__\n    ).parameters.keys()\n    protocol_signature = signature(SparseEmbeddingFunction.__call__).parameters.keys()\n\n    if not function_signature == protocol_signature:\n        raise ValueError(\n            f\"Expected SparseEmbeddingFunction.__call__ to have the following signature: {protocol_signature}, got {function_signature}\\n\"\n            \"Please see https://docs.trychroma.com/guides/embeddings for details of the SparseEmbeddingFunction interface.\\n\"\n        )\n\n\n# Index Configuration Types for Collection Schema\ndef _create_extra_fields_validator(valid_fields: list[str]) -> Any:\n    \"\"\"Create a model validator that provides helpful error messages for invalid fields.\"\"\"\n\n    @model_validator(mode=\"before\")\n    def validate_extra_fields(cls: Type[BaseModel], data: Any) -> Any:\n        if isinstance(data, dict):\n            invalid_fields = [k for k in data.keys() if k not in valid_fields]\n            if invalid_fields:\n                invalid_fields_str = \", \".join(f\"'{f}'\" for f in invalid_fields)\n                class_name = cls.__name__\n                # Create a clear, actionable error message\n                if len(invalid_fields) == 1:","sourceCodeStart":1562,"sourceCodeEnd":1598,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/types.py#L1562-L1598","documentation":"Error \"Expected SparseEmbeddingFunction.__call__ to have the following signature: {protocol_signature}, got {function_signature}\\nPlease see https://docs.trychroma.com/guides/embeddings for details of the SparseEmbeddingFunction interface.\\n\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/api/types.py:1580 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"}