Class RerankConfig
java.lang.Object
io.agentscope.core.rag.integration.dify.RerankConfig
Rerank configuration for Dify knowledge base retrieval.
Reranking improves retrieval quality by re-scoring documents using a specialized ranking model. This is typically applied after initial retrieval to refine results.
Example usage:
RerankConfig rerankConfig = RerankConfig.builder()
.providerName("cohere") // Optional: reranking provider
.modelName("rerank-english-v2.0") // Optional: model name
.topN(5) // Optional: top N after reranking
.build();
DifyRAGConfig config = DifyRAGConfig.builder()
.enableRerank(true)
.rerankConfig(rerankConfig)
.build();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RerankConfig.Builderbuilder()Creates a new builder for RerankConfig.Gets the rerank model name.Gets the rerank provider name.toString()
-
Method Details
-
getProviderName
Gets the rerank provider name.- Returns:
- the provider name (e.g., "cohere", "jina"), or null if using default
-
getModelName
Gets the rerank model name.- Returns:
- the model name, or null if using default
-
builder
Creates a new builder for RerankConfig.- Returns:
- a new Builder instance
-
toString
-