chroma-core/chroma · error · ValueError
Expected document to be a str, got {document}
Error message
Expected document to be a str, got {document} What it means
Error "Expected document to be a str, got {document}" thrown in chroma-core/chroma.
Source
Thrown at chromadb/api/types.py:1455
return vectors
def validate_documents(documents: Documents, nullable: bool = False) -> None:
"""Validates documents to ensure it is a list of strings"""
if not isinstance(documents, list):
raise ValueError(
f"Expected documents to be a list, got {type(documents).__name__}"
)
if len(documents) == 0:
raise ValueError(
f"Expected documents to be a non-empty list, got {len(documents)} documents"
)
for document in documents:
# If embeddings are present, some documents can be None
if document is None and nullable:
continue
if not is_document(document):
raise ValueError(f"Expected document to be a str, got {document}")
def validate_images(images: Images) -> None:
"""Validates images to ensure it is a list of numpy arrays"""
if not isinstance(images, list):
raise ValueError(f"Expected images to be a list, got {type(images).__name__}")
if len(images) == 0:
raise ValueError(
f"Expected images to be a non-empty list, got {len(images)} images"
)
for image in images:
if not is_image(image):
raise ValueError(f"Expected image to be a numpy array, got {image}")
def validate_batch(
batch: Tuple[
IDs,View on GitHub (pinned to aecdd12c8a)
When it happens
Trigger: Thrown at chromadb/api/types.py:1455 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/e01a85b081a501dc.
Report an issue: GitHub.