AS AgentScopeAPI 手册 / API Reference

RerankConfig

public class RerankConfig
源码Source io/agentscope/core/rag/integration/dify/RerankConfig.java:38–147

重排配置,保存相关配置项。位于 io.agentscope.core.rag.integration.dify 包。核心成员包括 getProviderName、getModelName、builder、toString。

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

类Class类型Kind说明Description
Builder类class
RerankConfig的构建器。
Builder for RerankConfig.

方法摘要Method Summary

方法Method说明Description
public String getProviderName()
获取重排提供者名称。
Gets the rerank provider name.
public String getModelName()
获取重排模型名称。
Gets the rerank model name.
public static Builder builder()
static
创建新的构建器用于 RerankConfig。
Creates a new builder for RerankConfig.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

getProviderName

public String getProviderName()

获取重排提供者名称。

Gets the rerank provider name.

返回Returns String
返回字符串结果。the provider name (e.g., "cohere", "jina"), or null if using default
源码Source io/agentscope/core/rag/integration/dify/RerankConfig.java:53–55

getModelName

public String getModelName()

获取重排模型名称。

Gets the rerank model name.

返回Returns String
返回字符串结果。the model name, or null if using default
源码Source io/agentscope/core/rag/integration/dify/RerankConfig.java:62–64

builder

public static Builder builder()
static

创建新的构建器用于 RerankConfig。

Creates a new builder for RerankConfig.

返回Returns Builder
一种新的构建器实例。a new Builder instance
源码Source io/agentscope/core/rag/integration/dify/RerankConfig.java:71–73

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/dify/RerankConfig.java:137–146

嵌套类详情Nested Class Detail

Builder

public static class Builder

RerankConfig的构建器。位于 io.agentscope.core.rag.integration.dify 包。核心成员包括 providerName、modelName、build。

Builder for RerankConfig.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.