chroma-core/chroma · error · ValueError

Google Vertex only supports text documents, not images

Error message

Google Vertex only supports text documents, not images

What it means

Capability guard in GoogleVertexEmbeddingFunction.__call__: Vertex AI text-embedding models accept only strings, so input lists containing non-string items (e.g. images) are rejected before the API call.

Solutions

  1. Pass only text documents to the Vertex embedding function
  2. Use a multimodal model/function for images
  3. Cast or filter inputs to strings before embedding
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:563 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/e69cd6a74235c9d4. Report an issue: GitHub.

Appendix: source

Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:563

            project=project_id,
            location=region,
            request_metadata=[("x-goog-api-client", f"chroma/{__version__}")],
        )
        self._model = TextEmbeddingModel.from_pretrained(model_name)

    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 Vertex only works with text documents
        if not all(isinstance(item, str) for item in input):
            raise ValueError("Google Vertex only supports text documents, not images")

        embeddings_list: List[npt.NDArray[np.float32]] = []
        for text in input:
            embedding_result = self._model.get_embeddings([text])
            embeddings_list.append(
                np.array(embedding_result[0].values, dtype=np.float32)
            )

        # Convert to the expected Embeddings type (List[Vector])
        return cast(Embeddings, embeddings_list)

    @staticmethod
    def name() -> str:
        return "google_vertex"

    def default_space(self) -> Space:
        return "cosine"

View on GitHub (pinned to aecdd12c8a)