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 Details

    • batch

      List<List<Document>> batch(List<Document> documents)
      EmbeddingModel implementations can call this method to optimize embedding tokens. The incoming collection of Documents are split into su-batches.
      Parameters:
      documents - to batch
      Returns:
      a list of sub-batches that contain Documents.