Record Class InfinispanStoreConfiguration

java.lang.Object
java.lang.Record
dev.langchain4j.store.embedding.infinispan.InfinispanStoreConfiguration

public record InfinispanStoreConfiguration(String cacheName, Integer dimension, Integer distance, String similarity, String cacheConfig, String packageItem, String fileName, String langchainItemName, String metadataItemName, boolean createCache, boolean registerSchema) extends Record
Holds configuration for the store
  • Field Details

    • DEFAULT_CACHE_CONFIG

      public static final String DEFAULT_CACHE_CONFIG
      Default Cache Config
      See Also:
    • DEFAULT_ITEM_PACKAGE

      public static final String DEFAULT_ITEM_PACKAGE
      Default package of the schema
      See Also:
    • DEFAULT_LANGCHAIN_ITEM

      public static final String DEFAULT_LANGCHAIN_ITEM
      Default name of the protobuf langchain item. Size will be added
      See Also:
    • DEFAULT_METADATA_ITEM

      public static final String DEFAULT_METADATA_ITEM
      Default name of the protobuf metadata item. Size will be added
      See Also:
    • DEFAULT_DISTANCE

      public static final int DEFAULT_DISTANCE
      The default distance to for the search
      See Also:
    • DEFAULT_SIMILARITY

      public static final String DEFAULT_SIMILARITY
      Default vector similarity
      See Also:
  • Constructor Details

    • InfinispanStoreConfiguration

      public InfinispanStoreConfiguration(String cacheName, Integer dimension, Integer distance, String similarity, String cacheConfig, String packageItem, String fileName, String langchainItemName, String metadataItemName, boolean createCache, boolean registerSchema)
      Creates the configuration and sets default values
      Parameters:
      cacheName - , mandatory
      dimension - , mandatory
      distance - , defaults to 3
      similarity - , defaults COUSINE
      cacheConfig - , the full cache configuration
      packageItem - , optional the package item
      fileName - , optional file name
      langchainItemName - , optional item name
      metadataItemName - , optional metadata item name
      createCache - , defaults to true. Disables creating the cache on startup
      registerSchema - , defaults to true. Disables registering the schema in the server
  • Method Details

    • langchainItemFullType

      public String langchainItemFullType()
      Get the full name of the langchainItem protobuf type
      Returns:
      langchainItemFullType
    • metadataFullType

      public String metadataFullType()
      Get the full name of the metadata protobuf type
      Returns:
      metadataFullType
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • cacheName

      public String cacheName()
      Returns the value of the cacheName record component.
      Returns:
      the value of the cacheName record component
    • dimension

      public Integer dimension()
      Returns the value of the dimension record component.
      Returns:
      the value of the dimension record component
    • distance

      public Integer distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • similarity

      public String similarity()
      Returns the value of the similarity record component.
      Returns:
      the value of the similarity record component
    • cacheConfig

      public String cacheConfig()
      Returns the value of the cacheConfig record component.
      Returns:
      the value of the cacheConfig record component
    • packageItem

      public String packageItem()
      Returns the value of the packageItem record component.
      Returns:
      the value of the packageItem record component
    • fileName

      public String fileName()
      Returns the value of the fileName record component.
      Returns:
      the value of the fileName record component
    • langchainItemName

      public String langchainItemName()
      Returns the value of the langchainItemName record component.
      Returns:
      the value of the langchainItemName record component
    • metadataItemName

      public String metadataItemName()
      Returns the value of the metadataItemName record component.
      Returns:
      the value of the metadataItemName record component
    • createCache

      public boolean createCache()
      Returns the value of the createCache record component.
      Returns:
      the value of the createCache record component
    • registerSchema

      public boolean registerSchema()
      Returns the value of the registerSchema record component.
      Returns:
      the value of the registerSchema record component