Move batching strategy to base vector store builder
Moving BatchingStrategy configuration from individual vector store implementations to the base AbstractVectorStoreBuilder to reduce code duplication and provide consistent batching behavior across all vector stores. The default TokenCountBatchingStrategy is now set in the base builder class.
This commit is contained in:
committed by
Ilayaperumal Gopinathan
parent
6a5326816c
commit
9844a18983
@@ -203,8 +203,6 @@ public class PgVectorStore extends AbstractObservationVectorStore implements Ini
|
||||
|
||||
private final PgVectorSchemaValidator schemaValidator;
|
||||
|
||||
private final BatchingStrategy batchingStrategy;
|
||||
|
||||
private final int maxDocumentBatchSize;
|
||||
|
||||
/**
|
||||
@@ -235,7 +233,6 @@ public class PgVectorStore extends AbstractObservationVectorStore implements Ini
|
||||
this.createIndexMethod = builder.indexType;
|
||||
this.initializeSchema = builder.initializeSchema;
|
||||
this.schemaValidator = new PgVectorSchemaValidator(this.jdbcTemplate);
|
||||
this.batchingStrategy = builder.batchingStrategy;
|
||||
this.maxDocumentBatchSize = builder.maxDocumentBatchSize;
|
||||
}
|
||||
|
||||
@@ -599,8 +596,6 @@ public class PgVectorStore extends AbstractObservationVectorStore implements Ini
|
||||
|
||||
private boolean initializeSchema;
|
||||
|
||||
private BatchingStrategy batchingStrategy = new TokenCountBatchingStrategy();
|
||||
|
||||
private int maxDocumentBatchSize = MAX_DOCUMENT_BATCH_SIZE;
|
||||
|
||||
private PgVectorStoreBuilder(JdbcTemplate jdbcTemplate, EmbeddingModel embeddingModel) {
|
||||
@@ -649,11 +644,6 @@ public class PgVectorStore extends AbstractObservationVectorStore implements Ini
|
||||
return this;
|
||||
}
|
||||
|
||||
public PgVectorStoreBuilder batchingStrategy(BatchingStrategy batchingStrategy) {
|
||||
this.batchingStrategy = batchingStrategy;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PgVectorStoreBuilder maxDocumentBatchSize(int maxDocumentBatchSize) {
|
||||
this.maxDocumentBatchSize = maxDocumentBatchSize;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user