Package org.springframework.ai.embedding
Interface BatchingStrategy
- All Known Implementing Classes:
TokenCountBatchingStrategy
public interface BatchingStrategy
Contract for batching
Document
objects so that the call to embed them could be
optimized.- Since:
- 1.0.0
- Author:
- Soby Chacko
-
Method Summary
-
Method Details
-
batch
EmbeddingModel
implementations can call this method to optimize embedding tokens. The incoming collection ofDocument
s are split into su-batches.- Parameters:
documents
- to batch- Returns:
- a list of sub-batches that contain
Document
s.
-