RAGFlowClient
public class RAGFlowClient
源码Source
io/agentscope/core/rag/integration/ragflow/RAGFlowClient.java:48–397用于RAGFlow API的HTTP 客户端。位于 io.agentscope.core.rag.integration.ragflow 包。核心成员包括 retrieve、RAGFlowClient。
HTTP client for RAGFlow API.
This client handles all HTTP communication with RAGFlow service, including:
-
Knowledge retrieval
-
Authentication
-
Error handling and retry logic
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public RAGFlowClient(RAGFlowConfig config) | 初始化 `RAGFlowClient` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Mono<RAGFlowResponse> retrieve(String question, Integer topK, Double similarityThreshold, Map<String, Object> metadataCondition) | 按查询检索相关文档。 Retrieve documents from RAGFlow knowledge base. |
构造器详情Constructor Detail
RAGFlowClient
public RAGFlowClient(RAGFlowConfig config)
初始化 RAGFlowClient 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | RAGFlowConfig | 配置对象(类型 `RAGFlowConfig`)。The config. |
源码Source
io/agentscope/core/rag/integration/ragflow/RAGFlowClient.java:58–61方法详情Method Detail
retrieve
public Mono<RAGFlowResponse> retrieve(String question, Integer topK, Double similarityThreshold, Map<String, Object> metadataCondition)
按查询检索相关文档。
Retrieve documents from RAGFlow knowledge base.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
question | String | 查询文本(必填)。the query text (required) |
topK | Integer | top K(类型 `Integer`)。the number of documents to retrieve (optional, defaults to config value) |
similarityThreshold | Double | similarity 阈值(类型 `Double`)。the minimum similarity threshold (optional, defaults to config value) |
metadataCondition | Map<String, Object> | 元数据 Condition(类型 `Map`)。metadata filtering conditions (optional) |
Mono<RAGFlowResponse>返回Mono。a Mono emitting the retrieval response
源码Source
io/agentscope/core/rag/integration/ragflow/RAGFlowClient.java:99–263