Files
lancedb/python/python
Alex Castillo González 6907440bc1 fix(python): split Cohere embedding requests into batches of 96 (#4834)
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).

---------
2026-11-30 23:11:52 +08:00
..