chroma-core/chroma · error · ValueError
Expected SparseEmbeddingFunction.__call__ to have the follow
Error message
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 What it means
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.
Source
Thrown at chromadb/api/types.py:1580
return
@staticmethod
def validate_config(config: Dict[str, Any]) -> None:
"""Validate a config."""
return
def validate_sparse_embedding_function(
sparse_vector_function: SparseEmbeddingFunction[Embeddable],
) -> None:
"""Validate that a sparse vector function conforms to the SparseEmbeddingFunction protocol."""
function_signature = signature(
sparse_vector_function.__class__.__call__
).parameters.keys()
protocol_signature = signature(SparseEmbeddingFunction.__call__).parameters.keys()
if not function_signature == protocol_signature:
raise ValueError(
f"Expected SparseEmbeddingFunction.__call__ to have the following signature: {protocol_signature}, got {function_signature}\n"
"Please see https://docs.trychroma.com/guides/embeddings for details of the SparseEmbeddingFunction interface.\n"
)
# Index Configuration Types for Collection Schema
def _create_extra_fields_validator(valid_fields: list[str]) -> Any:
"""Create a model validator that provides helpful error messages for invalid fields."""
@model_validator(mode="before")
def validate_extra_fields(cls: Type[BaseModel], data: Any) -> Any:
if isinstance(data, dict):
invalid_fields = [k for k in data.keys() if k not in valid_fields]
if invalid_fields:
invalid_fields_str = ", ".join(f"'{f}'" for f in invalid_fields)
class_name = cls.__name__
# Create a clear, actionable error message
if len(invalid_fields) == 1:View on GitHub (pinned to aecdd12c8a)
When it happens
Trigger: Thrown at chromadb/api/types.py:1580 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/163a0a86de4593ce.
Report an issue: GitHub.