ElasticsearchVectorStoreConfigLoader

org.llm4s.config.ElasticsearchVectorStoreConfigLoader

Loads the llm4s.vectorstore.elasticsearch block into an org.llm4s.vectorstore.elasticsearch.ElasticsearchConfig.

llm4s-vectorstore-elasticsearch's reference.conf binds ELASTICSEARCH_URL, ELASTICSEARCH_INDEX, ELASTICSEARCH_API_KEY, ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD. Every setting has a default, so with none set this is a local cluster with security disabled. Blank values (an unset variable bound through application.conf) count as unset.

llm4s.vectorstore.elasticsearch {
 baseUrl    = "https://es.example.com:9200"
 index      = "docs"
 apiKey     = ${?ELASTICSEARCH_API_KEY}
 similarity = dot_product
 dimensions = 1536
}
for
 config <- ElasticsearchVectorStoreConfigLoader.default()
 store  <- ElasticsearchVectorStore(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[ElasticsearchConfig]

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

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

Attributes

Returns

the config, or a org.llm4s.error.ConfigurationError for an unreadable block, an unknown similarity, both an API key and a username set, a username without a password (or the reverse), or a setting org.llm4s.vectorstore.elasticsearch.ElasticsearchConfig#validate refuses