RerankerConfigLoader
Loads the reranker selected under llm4s.rerank into a org.llm4s.reranker.RerankProviderConfig.
llm4s-rag's reference.conf binds RERANK_PROVIDER, COHERE_RERANK_BASE_URL and COHERE_RERANK_MODEL there. The Cohere key is llm4s.rerank.cohere.apiKey when that is set, and otherwise Cohere's shared llm4s.credentials.cohere.apiKey, bound to COHERE_API_KEY - the key the Cohere chat provider uses too, so one variable serves both. Either place may set apiKeyFile instead, a file holding the key: it is read at load and again whenever it changes, so a key a secret manager rotates is used without rebuilding the reranker (#2478).
for
reranker <- RerankerConfigLoader.default()
rag <- RAG.build(config, resolveRerankerConfig = () => Right(reranker))
yield rag
Only Cohere is configured here. llm reranking needs an LLMClient, which config cannot supply: select it in code with RAGConfig.withLLMReranking or RerankerFactory.llm.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RerankerConfigLoader.type