{"record":{"id":"7a95e4089677b190","repo":"chroma-core/chroma","slug":"failed-to-generate-mistral-embeddings","errorCode":null,"errorMessage":"Failed to generate Mistral embeddings","messagePattern":"Failed to generate Mistral embeddings","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/ai-embeddings/mistral/src/index.ts","lineNumber":52,"sourceCode":"    if (!apiKey) {\n      console.warn(\n        `Mistral API key is not set. Please provide it in the constructor or set the environment variable ${apiKeyEnvVar}.`,\n      );\n    }\n\n    this.model = model;\n    this.apiKeyEnvVar = apiKeyEnvVar;\n    this.client = new Mistral({ apiKey });\n  }\n\n  public async generate(texts: string[]): Promise<number[][]> {\n    const response = await this.client.embeddings.create({\n      model: this.model,\n      inputs: texts,\n    });\n\n    if (!response.data || !response.data.every((e) => e !== undefined)) {\n      throw new Error(\"Failed to generate Mistral embeddings\");\n    }\n\n    return response.data?.map((e) => e.embedding!);\n  }\n\n  public defaultSpace(): EmbeddingFunctionSpace {\n    return \"cosine\";\n  }\n\n  public supportedSpaces(): EmbeddingFunctionSpace[] {\n    return [\"cosine\", \"l2\", \"ip\"];\n  }\n\n  public static buildFromConfig(\n    config: MistralConfig,\n  ): MistralEmbeddingFunction {\n    return new MistralEmbeddingFunction({\n      model: config.model,","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/ai-embeddings/mistral/src/index.ts#L34-L70","documentation":"Error \"Failed to generate Mistral embeddings\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/ai-embeddings/mistral/src/index.ts:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}