{"record":{"id":"3918943333d9d0e3","repo":"Mintplex-Labs/anything-llm","slug":"cohere-failed-to-embed-error","errorCode":null,"errorMessage":"Cohere Failed to embed: ${error}","messagePattern":"Cohere Failed to embed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/EmbeddingEngines/cohere/index.js","lineNumber":90,"sourceCode":"        .filter((res) => !!res.error)\n        .map((res) => res.error)\n        .flat();\n\n      if (errors.length > 0) {\n        let uniqueErrors = new Set();\n        errors.map((error) =>\n          uniqueErrors.add(`[${error.type}]: ${error.message}`)\n        );\n        return { data: [], error: Array.from(uniqueErrors).join(\", \") };\n      }\n\n      return {\n        data: results.map((res) => res?.data || []).flat(),\n        error: null,\n      };\n    });\n\n    if (!!error) throw new Error(`Cohere Failed to embed: ${error}`);\n\n    return data.length > 0 &&\n      data.every((embd) => embd.hasOwnProperty(\"embedding\"))\n      ? data.map((embd) => embd.embedding)\n      : null;\n  }\n}\n\nmodule.exports = {\n  CohereEmbedder,\n};\n","sourceCodeStart":72,"sourceCodeEnd":102,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/EmbeddingEngines/cohere/index.js#L72-L102","documentation":"Aggregation guard in CohereEmbedder.embedChunks: chunk embedding sub-requests produced per-chunk errors that were collected and joined into one string, so the whole batch is failed with the deduplicated error detail rather than returning partial embeddings.","triggerScenarios":"Thrown when an embedding request to Cohere fails.","commonSituations":"Invalid key, model issue, or API error.","solutions":["Check the Cohere API key and embedding model.","Review the embedded error for details."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}