MCPcopy Index your code
hub / github.com/simstudioai/sim / splitByItemLimit

Function splitByItemLimit

apps/sim/lib/knowledge/embeddings.ts:313–320  ·  view source on GitHub ↗
(items: T[], limit: number)

Source from the content-addressed store, hash-verified

311}
312
313function splitByItemLimit<T>(items: T[], limit: number): T[][] {
314 if (items.length <= limit) return [items]
315 const result: T[][] = []
316 for (let i = 0; i < items.length; i += limit) {
317 result.push(items.slice(i, i + limit))
318 }
319 return result
320}
321
322async function processWithConcurrency<T, R>(
323 items: T[],

Callers 1

generateEmbeddingsFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected