chroma-core/chroma · error · ValueError
Google PaLM only supports text documents, not images
Error message
Google PaLM only supports text documents, not images
What it means
Raised by GooglePaLMEmbeddingFunction.__call__ when the input contains non-string entries. The deprecated PaLM API only embeds text, so passing images (or any non-string items) in the documents input is rejected before any API call is made.
Solutions
- Pass only text documents to the PaLM embedding function
- Use a multimodal embedding function for images
- Pre-convert non-string inputs to strings where appropriate
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:432 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/754f93078c09943b.
Report an issue: GitHub.
Appendix: source
Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:432
palm.configure(
api_key=self.api_key,
client_options={"headers": {"x-goog-api-client": f"chroma/{__version__}"}},
)
self._palm = palm
def __call__(self, input: Documents) -> Embeddings:
"""
Generate embeddings for the given documents.
Args:
input: Documents or images to generate embeddings for.
Returns:
Embeddings for the documents.
"""
# Google PaLM only works with text documents
if not all(isinstance(item, str) for item in input):
raise ValueError("Google PaLM only supports text documents, not images")
return [
np.array(
self._palm.generate_embeddings(model=self.model_name, text=text)[
"embedding"
],
dtype=np.float32,
)
for text in input
]
@staticmethod
def name() -> str:
return "google_palm"
def default_space(self) -> Space:
return "cosine"
View on GitHub (pinned to aecdd12c8a)