chroma-core/chroma · error · KeyError
No such key: {key}, valid keys are: {self.get_model_fields()
Error message
No such key: {key}, valid keys are: {self.get_model_fields()} What it means
Error "No such key: {key}, valid keys are: {self.get_model_fields()}" thrown in chroma-core/chroma.
Source
Thrown at chromadb/types.py:136
def __getitem__(self, key: str) -> Optional[Any]:
"""Allows the collection to be treated as a dictionary"""
if key == "configuration":
return self.get_configuration()
# For the other model attributes we allow the user to access them directly
if key in self.get_model_fields():
return getattr(self, key)
return None
# TODO: This doesn't check types.
def __setitem__(self, key: str, value: Any) -> None:
"""Allows the collection to be treated as a dictionary"""
# For the model attributes we allow the user to access them directly
if key == "configuration":
self.set_configuration(value)
if key in self.get_model_fields():
setattr(self, key, value)
else:
raise KeyError(
f"No such key: {key}, valid keys are: {self.get_model_fields()}"
)
def __eq__(self, __value: object) -> bool:
# Check that all the model fields are equal
if not isinstance(__value, Collection):
return False
for field in self.get_model_fields():
if getattr(self, field) != getattr(__value, field):
return False
return True
def get_configuration(self) -> CollectionConfiguration:
"""Returns the configuration of the collection"""
try:
return load_collection_configuration_from_json(self.configuration_json)
except Exception as e:
raise ValueError(View on GitHub (pinned to aecdd12c8a)
When it happens
Trigger: Thrown at chromadb/types.py:136 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/a5f40b6648704a17.
Report an issue: GitHub.