{"record":{"id":"fbd993d85f31e179","repo":"chroma-core/chroma","slug":"cohere-image-embedding-supports-a-maximum-of-96-te","errorCode":null,"errorMessage":"Cohere image embedding supports a maximum of 96 text inputs at a time","messagePattern":"Cohere image embedding supports a maximum of 96 text inputs at a time","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/ai-embeddings/cohere/src/index.ts","lineNumber":92,"sourceCode":"      );\n    }\n\n    this.client = new CohereClient({ token: apiKey });\n    this.apiKeyEnvVar = apiKeyEnvVar;\n    this.modelName = modelName;\n    this.inputType = inputType;\n    this.truncate = truncate;\n    this.embeddingType = embeddingType;\n    this.image = image;\n  }\n\n  public async generate(texts: string[]): Promise<number[][]> {\n    if (this.image && texts.length > 1) {\n      throw new Error(\"Cohere image embedding supports one image at a time\");\n    }\n\n    if (!this.image && texts.length > 96) {\n      throw new Error(\n        \"Cohere image embedding supports a maximum of 96 text inputs at a time\",\n      );\n    }\n\n    const response = await this.client.embed({\n      model: this.modelName,\n      inputType: this.image ? \"image\" : this.inputType,\n      truncate: this.truncate,\n      embeddingTypes: this.embeddingType ? [this.embeddingType] : undefined,\n      images: this.image ? texts : undefined,\n      texts: !this.image ? texts : undefined,\n    });\n\n    const embeddings = response.embeddings;\n    if (Array.isArray(embeddings)) {\n      return embeddings;\n    } else if (\n      this.embeddingType &&","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/ai-embeddings/cohere/src/index.ts#L74-L110","documentation":"Error \"Cohere image embedding supports a maximum of 96 text inputs at a time\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/ai-embeddings/cohere/src/index.ts:92 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"}