AS AgentScopeAPI 手册 / API Reference

RetrievalMode

public enum RetrievalMode
源码Source io/agentscope/core/rag/integration/dify/RetrievalMode.java:36–118

定义检索模式相关取值的枚举。位于 io.agentscope.core.rag.integration.dify 包。核心成员包括 getValue、fromValue、toString、KEYWORD_SEARCH、SEMANTIC_SEARCH、HYBRID_SEARCH。

Dify retrieval modes for knowledge base search.

Different retrieval modes use different strategies to find relevant documents:

  • KEYWORD_SEARCH: Traditional keyword-based search (BM25, TF-IDF)

  • SEMANTIC_SEARCH: Vector-based semantic similarity search

  • HYBRID_SEARCH: Combines keyword and semantic search (recommended)

  • FULL_TEXT_SEARCH: Full-text search across all document content

Example usage:

`DifyRAGConfig config = DifyRAGConfig.builder()
.retrievalMode(RetrievalMode.HYBRID_SEARCH) // Use hybrid search
.build();
`

枚举常量摘要Enum Constant Summary

常量Constant说明Description
KEYWORD_SEARCH
执行KEYWORD 搜索相关操作。
Keyword-based retrieval using BM25 or similar algorithms.
SEMANTIC_SEARCH
执行SEMANTIC 搜索相关操作。
Semantic retrieval using vector embeddings and similarity search.
HYBRID_SEARCH
执行HYBRID 搜索相关操作。
Hybrid retrieval combining keyword and semantic approaches.
FULL_TEXT_SEARCH
执行FULL 文本搜索相关操作。
Full-text search across all document content.

方法摘要Method Summary

方法Method说明Description
public String getValue()
获取值。
Gets the string value for use in Dify API requests.
public static RetrievalMode fromValue(String value)
static
设置来自值。
Converts a string value to the corresponding RetrievalMode enum.
public String toString()
返回 `toString` 结果。
Returns the to string.

枚举常量详情Enum Constant Detail

方法详情Method Detail

getValue

public String getValue()

获取值。

Gets the string value for use in Dify API requests.

返回Returns String
返回字符串结果。the API value
源码Source io/agentscope/core/rag/integration/dify/RetrievalMode.java:85–87

fromValue

public static RetrievalMode fromValue(String value)
static

设置来自值。

Converts a string value to the corresponding RetrievalMode enum.

参数Parameters
名称Name类型Type说明Description
valueString值(类型 `String`)。the string value
返回Returns RetrievalMode
返回RetrievalMode。the matching RetrievalMode
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if the value doesn't match any mode
源码Source io/agentscope/core/rag/integration/dify/RetrievalMode.java:96–112

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/dify/RetrievalMode.java:114–117
基于官方固定版本源码静态生成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.