Builder
public static class Builder
io/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:302–723构建器,用于构建并配置目标实例。位于 io.agentscope.core.rag.integration.ragflow 包。核心成员包括 apiKey、baseUrl、datasetIds、addDatasetId、documentIds、addDocumentId。
A class in io.agentscope.core.rag.integration.ragflow that turns private documents into retrievable knowledge. Declared in io.agentscope.core.rag.integration.ragflow.
方法摘要Method Summary
方法详情Method Detail
apiKey
public Builder apiKey(String apiKey)
设置RAGFlow API 密钥。
Sets the RAGFlow API key.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 密钥(必填)。the API key (required) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:348–351baseUrl
public Builder baseUrl(String baseUrl)
设置RAGFlow 基类 URL。
Sets the RAGFlow base URL.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL。the base URL |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:361–364datasetIds
public Builder datasetIds(List<String> datasetIds)
设置该配置项。
Sets the dataset IDs (replaces existing list).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
datasetIds | List<String> | dataset Ids(类型 `List`)。the list of dataset IDs (required, at least one) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:375–378addDatasetId
public Builder addDatasetId(String datasetId)
添加 addDatasetId。
Adds a single dataset ID to the list.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
datasetId | String | dataset 标识(类型 `String`)。the dataset ID to add |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:386–389documentIds
public Builder documentIds(List<String> documentIds)
设置文档 IDs 到过滤检索(可选)。
Sets the document IDs to filter retrieval (optional).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
documentIds | List<String> | 文档 IDs的列出。the list of document IDs |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:399–402addDocumentId
public Builder addDocumentId(String documentId)
添加文档标识。
Adds a single document ID to the filter list.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
documentId | String | 文档标识到添加。the document ID to add |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:410–416topK
public Builder topK(Integer topK)
设置该配置项。
Sets the top K value for retrieval.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
topK | Integer | top K(类型 `Integer`)。the number of chunks to retrieve (must be > 0) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:426–432similarityThreshold
public Builder similarityThreshold(Double similarityThreshold)
设置该配置项。
Sets the similarity threshold.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
similarityThreshold | Double | similarity 阈值(类型 `Double`)。the similarity threshold (0.0-1.0) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:444–452vectorSimilarityWeight
public Builder vectorSimilarityWeight(Double vectorSimilarityWeight)
设置该配置项。
Sets the vector similarity weight.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
vectorSimilarityWeight | Double | 权重(0.0-1.0)。the weight (0.0-1.0) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:465–473page
public Builder page(Integer page)
设置页码。
Sets the page number for pagination.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
page | Integer | 页码数量(>=1)。the page number (>= 1) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:483–489pageSize
public Builder pageSize(Integer pageSize)
设置页码大小。
Sets the page size for pagination.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
pageSize | Integer | 页码大小(>=1)。the page size (>= 1) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:499–505useKg
public Builder useKg(Boolean useKg)
设置使用 Kg。
Sets whether to use knowledge graph for multi-hop queries.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
useKg | Boolean | 使用 Kg(类型 `Boolean`)。true to enable knowledge graph |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:518–521tocEnhance
public Builder tocEnhance(Boolean tocEnhance)
设置该配置项。
Sets whether to use TOC (Table of Contents) enhancement.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tocEnhance | Boolean | toc Enhance(类型 `Boolean`)。true to enable TOC enhancement |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:534–537rerankId
public Builder rerankId(String rerankId)
设置重排模型标识。
Sets the rerank model ID.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
rerankId | String | 重排模型标识。the rerank model ID |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:549–552rerankId
public Builder rerankId(Integer rerankId)
设置重排标识。
Sets the rerank model ID from a numeric value.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
rerankId | Integer | 重排模型标识。the rerank model ID |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:564–568keyword
public Builder keyword(Boolean keyword)
设置该配置项。
Sets whether to enable keyword-based matching.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
keyword | Boolean | keyword(类型 `Boolean`)。true to enable keyword matching |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:578–581highlight
public Builder highlight(Boolean highlight)
设置该配置项。
Sets whether to enable highlighting of matched terms in results.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
highlight | Boolean | highlight(类型 `Boolean`)。true to enable highlighting |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:591–594crossLanguages
public Builder crossLanguages(List<String> crossLanguages)
设置该配置项。
Sets the languages for cross-language retrieval.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
crossLanguages | List<String> | cross Languages(类型 `List`)。the list of target languages |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:605–608addCrossLanguage
public Builder addCrossLanguage(String language)
添加 addCrossLanguage。
Adds a language for cross-language retrieval.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
language | String | language(类型 `String`)。the target language to add |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:616–622metadataCondition
public Builder metadataCondition(Map<String, Object> metadataCondition)
设置该配置项。
Sets the metadata filtering condition.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metadataCondition | Map<String, Object> | 元数据 Condition(类型 `Map`)。the metadata condition map |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:639–643timeout
public Builder timeout(Duration timeout)
设置HTTP 超时。
Sets the HTTP timeout.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
timeout | Duration | 超时时长。the timeout duration |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:653–656maxRetries
public Builder maxRetries(Integer maxRetries)
设置最大重试。
Sets the maximum number of retries for failed requests.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxRetries | Integer | 最大重试(>=0)。the max retries (>= 0) |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:666–672customHeaders
public Builder customHeaders(Map<String, String> customHeaders)
设置自定义 HTTP 请求头。
Sets custom HTTP headers.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customHeaders | Map<String, String> | 自定义请求头映射。the custom headers map |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:680–683addCustomHeader
public Builder addCustomHeader(String key, String value)
添加自定义请求头。
Adds a custom HTTP header.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 请求头名称。the header name |
value | String | 请求头值。the header value |
Builderio/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:692–695build
public RAGFlowConfig build()
构建RAGFlowConfig 实例。
Builds the RAGFlowConfig instance.
RAGFlowConfigIllegalArgumentException可能抛出 `IllegalArgumentException`。if required parameters are missing
io/agentscope/core/rag/integration/ragflow/RAGFlowConfig.java:707–722