Class PostgresTableConfig
java.lang.Object
com.google.genkit.plugins.postgresql.PostgresTableConfig
Configuration for a PostgreSQL table used for vector storage.
This class configures how documents are stored in a PostgreSQL table with pgvector support.
Example usage:
PostgresTableConfig config = PostgresTableConfig.builder().tableName("documents")
.embedderName("googleai/text-embedding-004").vectorDimension(768).distanceStrategy(DistanceStrategy.COSINE)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for PostgresTableConfig.static enumDistance strategies for vector similarity search. -
Method Summary
Modifier and TypeMethodDescriptionstatic PostgresTableConfig.Builderbuilder()Creates a new builder for PostgresTableConfig.Gets additional metadata to add to all indexed documents.Gets the content column name.Gets the distance strategy for similarity search.Gets the embedder name for generating vectors.Gets the embedding column name.Gets the ID column name.intGets the number of lists for IVFFlat index.Gets the metadata column name.Gets the table name.intGets the vector dimension.booleanReturns whether to create the index if it doesn't exist.booleanReturns whether to create the table if it doesn't exist.
-
Method Details
-
builder
Creates a new builder for PostgresTableConfig. -
getTableName
Gets the table name. -
getEmbedderName
Gets the embedder name for generating vectors. -
getVectorDimension
public int getVectorDimension()Gets the vector dimension. -
getDistanceStrategy
Gets the distance strategy for similarity search. -
getIdColumn
Gets the ID column name. -
getContentColumn
Gets the content column name. -
getEmbeddingColumn
Gets the embedding column name. -
getMetadataColumn
Gets the metadata column name. -
isCreateTableIfNotExists
public boolean isCreateTableIfNotExists()Returns whether to create the table if it doesn't exist. -
isCreateIndexIfNotExists
public boolean isCreateIndexIfNotExists()Returns whether to create the index if it doesn't exist. -
getIndexLists
public int getIndexLists()Gets the number of lists for IVFFlat index. -
getAdditionalMetadata
Gets additional metadata to add to all indexed documents.
-