Class JdbcChatMemoryStoreConfiguration

java.lang.Object
io.micronaut.langchain4j.jdbc.memory.JdbcChatMemoryStoreConfiguration
All Implemented Interfaces:
io.micronaut.core.util.Toggleable

@EachProperty(value="langchain4j.chat-memory-store.jdbc", primary="default") public final class JdbcChatMemoryStoreConfiguration extends Object implements io.micronaut.core.util.Toggleable
Configures a JDBC SQLChatMemoryStore for a data source. The name of the configuration is the name of the data source.
Since:
2.4.0
  • Field Details

  • Constructor Details

    • JdbcChatMemoryStoreConfiguration

      public JdbcChatMemoryStoreConfiguration(@Parameter DataSource dataSource)
      Parameters:
      dataSource - The data source with the same name as the configuration
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface io.micronaut.core.util.Toggleable
    • setEnabled

      public void setEnabled(boolean enabled)
      Parameters:
      enabled - Whether the JDBC chat memory store is enabled. Defaults to true.
    • getDialect

      public @Nullable JdbcChatMemoryStoreConfiguration.Dialect getDialect()
      Returns:
      The SQL dialect, or null to detect it from the database
    • setDialect

      public void setDialect(@Nullable JdbcChatMemoryStoreConfiguration.Dialect dialect)
      Parameters:
      dialect - The SQL dialect. Detected from the database by default.
    • getDataSource

      public DataSource getDataSource()
      Returns:
      The data source
    • getBuilder

      public dev.langchain4j.community.store.memory.chat.sql.SQLChatMemoryStore.SQLChatMemoryStoreBuilder getBuilder()
      Returns:
      The builder of the store, configured with the table-name, auto-create-table, memory-id-column-name and content-column-name properties