Class RAGFlowClient
java.lang.Object
io.agentscope.core.rag.integration.ragflow.RAGFlowClient
HTTP client for RAGFlow API.
This client handles all HTTP communication with RAGFlow service, including:
- Knowledge retrieval
- Authentication
- Error handling and retry logic
- Author:
- RAGFlow Integration Team
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RAGFlowClient
-
-
Method Details
-
retrieve
public reactor.core.publisher.Mono<RAGFlowResponse> retrieve(String question, Integer topK, Double similarityThreshold, Map<String, Object> metadataCondition) Retrieve documents from RAGFlow knowledge base.This method calls the RAGFlow retrieval API to search for relevant document chunks. The API endpoint is:
POST /api/v1/retrievalReal API Format:
{ "question": "What is advantage of ragflow?", "dataset_ids": ["b2a62730759d11ef987d0242ac120004"], "document_ids": ["77df9ef4759a11ef8bdd0242ac120004"], // optional "top_k": 10, "similarity_threshold": 0.3, "metadata_condition": { "logic": "and", "conditions": [ {"name": "author", "comparison_operator": "=", "value": "Toby"} ] } }- Parameters:
question- the query text (required)topK- the number of documents to retrieve (optional, defaults to config value)similarityThreshold- the minimum similarity threshold (optional, defaults to config value)metadataCondition- metadata filtering conditions (optional)- Returns:
- a Mono emitting the retrieval response
-