chroma-core/chroma · error · Error
Invalid response format: missing or invalid embeddings array
Error message
Invalid response format: missing or invalid embeddings array
What it means
The Chroma Cloud SPLADE endpoint returned a JSON body whose `embeddings` field is absent or not an array (e.g. an error payload, HTML, or a differently-shaped response). The guard in generate() checks Array.isArray(data.embeddings) before sorting/returning sparse vectors, so any non-array shape fails here.
Solutions
- Inspect the raw response body (status code, text) to see what the API actually returned — often an auth or quota error
- Verify the endpoint URL and request payload match the current SPLADE sparse-embeddings API contract
- Retry after fixing credentials or the API error indicated in the response
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at clients/new-js/packages/ai-embeddings/chroma-cloud-splade/src/index.ts:146 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/a7875fa00ab42dd7.
Report an issue: GitHub.
Appendix: source
Thrown at clients/new-js/packages/ai-embeddings/chroma-cloud-splade/src/index.ts:146
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(
`HTTP ${response.status} ${response.statusText}: ${errorText}`,
);
}
const data =
(await response.json()) as ChromaCloudSparseEmbeddingsResponse;
// Validate response structure
if (!data || typeof data !== "object") {
throw new Error("Invalid response format: expected object");
}
if (!Array.isArray(data.embeddings)) {
throw new Error(
"Invalid response format: missing or invalid embeddings array",
);
}
// Sort the sparse vectors to match Python behavior
sortSparseVectors(data.embeddings);
return data.embeddings;
} catch (error) {
if (error instanceof Error) {
throw new Error(`Error calling Chroma Embedding API: ${error.message}`);
} else {
throw new Error(`Error calling Chroma Embedding API: ${error}`);
}
}
}
public async generateForQueries(texts: string[]): Promise<SparseVector[]> {View on GitHub (pinned to aecdd12c8a)