OpenSearchVectorStoreConfigLoader

org.llm4s.config.OpenSearchVectorStoreConfigLoader

Loads the llm4s.vectorstore.opensearch block into an org.llm4s.vectorstore.opensearch.OpenSearchConfig.

llm4s-vectorstore-elasticsearch's reference.conf binds OPENSEARCH_URL, OPENSEARCH_INDEX, OPENSEARCH_USERNAME, OPENSEARCH_PASSWORD and OPENSEARCH_TOKEN. Every setting has a default, so with none set this is a local cluster with the security plugin disabled. Blank values (an unset variable bound through application.conf) count as unset.

llm4s.vectorstore.opensearch {
 baseUrl   = "https://search.example.com:9200"
 index     = "docs"
 username  = llm4s
 password  = ${?OPENSEARCH_PASSWORD}
 spaceType = innerproduct
 engine    = faiss
}
for
 config <- OpenSearchVectorStoreConfigLoader.default()
 store  <- OpenSearchVectorStore(config)
yield store

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

load against the current environment: system properties, application.conf and every reference.conf.

load against the current environment: system properties, application.conf and every reference.conf.

Attributes

def load(source: ConfigSource): Result[OpenSearchConfig]

Reads llm4s.vectorstore.opensearch from source and checks the result.

Reads llm4s.vectorstore.opensearch from source and checks the result.

Attributes

Returns

the config, or a org.llm4s.error.ConfigurationError for an unreadable block, an unknown space type or engine, both a token and a username set, a username without a password (or the reverse), or a setting org.llm4s.vectorstore.opensearch.OpenSearchConfig#validate refuses