chroma-core/chroma · error · Error
Failed to generate VoyageAI embeddings
Error message
Failed to generate VoyageAI embeddings
What it means
Post-response check in VoyageAIEmbeddingFunction.generate: thrown when the Voyage API response has no data array or any per-text embedding entry is undefined, meaning the API returned a malformed or partial result rather than one embedding per input text.
Solutions
- Log the raw response to inspect VoyageAI's payload
- Verify model name, input_type, and truncation settings for the account
- Retry; escalate to VoyageAI support if the shape is persistently wrong
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at clients/new-js/packages/ai-embeddings/voyageai/src/index.ts:60 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/1512f7723e479f6f.
Report an issue: GitHub.
Appendix: source
Thrown at clients/new-js/packages/ai-embeddings/voyageai/src/index.ts:60
`Voyage API key is not set. Please provide it in the constructor or set the environment variable ${apiKeyEnvVar}.`,
);
}
this.modelName = modelName;
this.apiKeyEnvVar = apiKeyEnvVar;
this.inputType = inputType;
this.truncation = truncation !== undefined ? truncation : true;;
this.client = new VoyageAIClient({ apiKey });
}
public async generate(texts: string[]): Promise<number[][]> {
const response = await this.client.embed({
input: texts,
model: this.modelName,
});
if (!response.data || !response.data.every((e) => e !== undefined)) {
throw new Error("Failed to generate VoyageAI embeddings");
}
return response.data?.map((e) => e.embedding!);
}
public static buildFromConfig(
config: VoyageAIConfig,
): VoyageAIEmbeddingFunction {
return new VoyageAIEmbeddingFunction({
modelName: config.model_name,
apiKeyEnvVar: config.api_key_env_var,
inputType: config.input_type,
truncation: config.truncation,
});
}
public defaultSpace(): EmbeddingFunctionSpace {
return "cosine";View on GitHub (pinned to aecdd12c8a)