Class PostgresTableConfig.Builder
java.lang.Object
com.google.genkit.plugins.postgresql.PostgresTableConfig.Builder
- Enclosing class:
PostgresTableConfig
Builder for PostgresTableConfig.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadditionalMetadata(String key, Object value) Adds additional metadata to include with all indexed documents.additionalMetadata(Map<String, Object> metadata) Sets all additional metadata to include with indexed documents.build()Builds the PostgresTableConfig.contentColumn(String contentColumn) Sets the content column name (default: "content").createIndexIfNotExists(boolean createIndexIfNotExists) Sets whether to create the index if it doesn't exist (default: true).createTableIfNotExists(boolean createTableIfNotExists) Sets whether to create the table if it doesn't exist (default: true).distanceStrategy(PostgresTableConfig.DistanceStrategy distanceStrategy) Sets the distance strategy (default: COSINE).embedderName(String embedderName) Sets the embedder name for generating vectors (required).embeddingColumn(String embeddingColumn) Sets the embedding column name (default: "embedding").Sets the ID column name (default: "id").indexLists(int indexLists) Sets the number of lists for IVFFlat index (default: 100).metadataColumn(String metadataColumn) Sets the metadata column name (default: "metadata").Sets the table name (required).vectorDimension(int vectorDimension) Sets the vector dimension (default: 768).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
tableName
Sets the table name (required). -
embedderName
Sets the embedder name for generating vectors (required). -
vectorDimension
Sets the vector dimension (default: 768). -
distanceStrategy
public PostgresTableConfig.Builder distanceStrategy(PostgresTableConfig.DistanceStrategy distanceStrategy) Sets the distance strategy (default: COSINE). -
idColumn
Sets the ID column name (default: "id"). -
contentColumn
Sets the content column name (default: "content"). -
embeddingColumn
Sets the embedding column name (default: "embedding"). -
metadataColumn
Sets the metadata column name (default: "metadata"). -
createTableIfNotExists
Sets whether to create the table if it doesn't exist (default: true). -
createIndexIfNotExists
Sets whether to create the index if it doesn't exist (default: true). -
indexLists
Sets the number of lists for IVFFlat index (default: 100). Higher values give better recall but slower builds. -
additionalMetadata
Adds additional metadata to include with all indexed documents. -
additionalMetadata
Sets all additional metadata to include with indexed documents. -
build
Builds the PostgresTableConfig.- Throws:
IllegalStateException- if required fields are not set
-