mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
Fixes a failure when adding 97 or more rows with a Cohere embedding function on SDK releases that do not batch. **Cause:** `CohereEmbeddingFunction.generate_embeddings` sends all texts to `client.embed`. Cohere's endpoint accepts at most 96 texts per call, and some releases (for example 5.0.0 to 5.1.2) send them as a single request. **Fix:** clients that batch on their own (4.x, and releases whose `embed` takes `batching`) get the full input, which keeps their concurrent requests. Other clients get chunks of 96, concatenated in order. **Test:** one test uses a client without batching and checks calls of 96/96/8. A second runs the installed SDK against a local transport and checks request sizes, order and concurrency where the SDK supports it. --- Disclosure: this change was prepared with AI assistance (Claude Code). ---------