Class OracleEmbeddingStore.Builder

java.lang.Object
dev.langchain4j.store.embedding.oracle.OracleEmbeddingStore.Builder
Enclosing class:
OracleEmbeddingStore

public static class OracleEmbeddingStore.Builder extends Object
Builder which configures and creates instances of OracleEmbeddingStore.
  • Method Details

    • dataSource

      public OracleEmbeddingStore.Builder dataSource(DataSource dataSource)
      Configures a data source that connects to an Oracle Database.
      Parameters:
      dataSource - Data source to configure. Not null.
      Returns:
      This builder. Not null.
      Throws:
      IllegalArgumentException - If the dataSource is null.
    • embeddingTable

      public OracleEmbeddingStore.Builder embeddingTable(String tableName)
      Configures the name of a table used to store embeddings, text, and metadata. The table must already exist and have the default column names.
      Parameters:
      tableName - The name of an existing table. Not null.
      Returns:
      The named embedding table. Not null;
      Throws:
      IllegalArgumentException - If the tableName is null.
    • embeddingTable

      public OracleEmbeddingStore.Builder embeddingTable(String tableName, CreateOption createOption)
      Configures the name of table used to store embeddings, text, and metadata. Depending on which CreateOption is provided, a table with the default column names may be created when build() is called.
      Parameters:
      tableName - The name of an existing table. Not null.
      createOption - Option for creating the table. Not null.
      Returns:
      This builder. Not null.
      Throws:
      IllegalArgumentException - If the tableName or createOption is null.
    • embeddingTable

      public OracleEmbeddingStore.Builder embeddingTable(EmbeddingTable embeddingTable)
      Configures a table used to store embeddings, text, and metadata. Depending on which CreateOption the table is configured with, it may be created when build() is called.
      Parameters:
      embeddingTable - The table used to store embeddings. Not null.
      Returns:
      This builder. Not null.
      Throws:
      IllegalArgumentException - If the embeddingTable is null.
    • vectorIndex

      public OracleEmbeddingStore.Builder vectorIndex(CreateOption createOption)
      Configures the creation of an index on the embedding column of the EmbeddingTable used by the embedding store. Depending on which CreateOption is provided, an index may be created when build() is called. The default createOption is CreateOption.CREATE_NONE.
      Parameters:
      createOption - Option for creating the index. Not null.
      Returns:
      This builder. Not null.
    • exactSearch

      public OracleEmbeddingStore.Builder exactSearch(boolean isExactSearch)
      Configures the embedding store to use exact or approximate similarity search. Approximate search is the default.
      Parameters:
      isExactSearch - true to configure exact search, or false for approximate.
      Returns:
      This builder. Not null.
    • build

      public OracleEmbeddingStore build()
      Builds an embedding store with the configuration applied to this builder.
      Returns:
      A new embedding store. Not null.
      Throws:
      RuntimeException - If connection to the database fails, or an error occurs when creating the schema objects.