AS AgentScopeAPI 手册 / API Reference

RAGFlowChunk

@JsonIgnoreProperties(ignoreUnknown = true) public class RAGFlowChunk
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:53–260

RAG Flow 分块,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.rag.integration.ragflow.model 包。核心成员包括 getId、setId、getContent、setContent、getContentLtks、setContentLtks。

RAGFlow chunk (document segment) model.

This class represents a chunk (text segment) returned by RAGFlow's retrieval API.

Real API Response Format:

`{
"id": "d78435d142bd5cf6704da62c778795c5",
"content": "ragflow content",
"content_ltks": "ragflow content",
"document_id": "5c5999ec7be811ef9cab0242ac120005",
"document_keyword": "1.txt",
"highlight": "<em>ragflow</em> content",
"kb_id": "c7ee74067a2c11efb21c0242ac120006",
"similarity": 0.9669436601210759,
"vector_similarity": 0.8898122004035864,
"term_similarity": 1.0,
"positions": [[0, 100], [200, 300]],
"image_id": "",
"important_keywords": ["ragflow", "content"]
}
`

Note: @JsonIgnoreProperties(ignoreUnknown = true) ensures forward compatibility with API changes.

方法摘要Method Summary

方法Method说明Description
public String getId()
获取标识。
Returns the id.
public void setId(String id)
设置标识。
Sets the id.
public String getContent()
获取内容。
Returns the content.
public void setContent(String content)
设置内容。
Sets the content.
public String getContentLtks()
获取 `getContentLtks`。
Returns the content ltks.
public void setContentLtks(String contentLtks)
设置 `setContentLtks`。
Sets the content ltks.
public String getHighlight()
获取 `getHighlight`。
Returns the highlight.
public void setHighlight(String highlight)
设置 `setHighlight`。
Sets the highlight.
public String getDocumentId()
获取文档标识。
Returns the document id.
public void setDocumentId(String documentId)
设置文档标识。
Sets the document id.
public String getDocumentKeyword()
获取 `getDocumentKeyword`。
Returns the document keyword.
public void setDocumentKeyword(String documentKeyword)
设置 `setDocumentKeyword`。
Sets the document keyword.
public String getKbId()
获取知识库标识。
Returns the kb id.
public void setKbId(String kbId)
设置知识库标识。
Sets the kb id.
public Double getSimilarity()
获取 `getSimilarity`。
Returns the similarity.
public void setSimilarity(Double similarity)
设置 `setSimilarity`。
Sets the similarity.
public Double getVectorSimilarity()
获取 `getVectorSimilarity`。
Returns the vector similarity.
public void setVectorSimilarity(Double vectorSimilarity)
设置 `setVectorSimilarity`。
Sets the vector similarity.
public Double getTermSimilarity()
获取 `getTermSimilarity`。
Returns the term similarity.
public void setTermSimilarity(Double termSimilarity)
设置 `setTermSimilarity`。
Sets the term similarity.
public List<List<Integer>> getPositions()
获取 `getPositions`。
Returns the positions.
public void setPositions(List<List<Integer>> positions)
设置 `setPositions`。
Sets the positions.
public String getImageId()
获取图像标识。
Returns the image id.
public void setImageId(String imageId)
设置图像标识。
Sets the image id.
public List<String> getImportantKeywords()
获取 `getImportantKeywords`。
Returns the important keywords.
public void setImportantKeywords(List<String> importantKeywords)
设置 `setImportantKeywords`。
Sets the important keywords.
public Map<String, Object> getMetadata()
获取元数据。
Returns the metadata.
public void setMetadata(Map<String, Object> metadata)
设置元数据。
Sets the metadata.
public String getDatasetId()
获取 `getDatasetId`。
Returns the dataset id.
public void setDatasetId(String datasetId)
设置 `setDatasetId`。
Sets the dataset id.
public String getDocumentName()
获取文档名称。
Returns the document name.
public void setDocumentName(String documentName)
设置文档名称。
Sets the document name.
public Double getScore()
获取分数。
Gets the similarity score.
public void setScore(Double score)
设置分数。
Sets the score.

方法详情Method Detail

getId

public String getId()

获取标识。

Returns the id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:113–115

setId

public void setId(String id)

设置标识。

Sets the id.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:117–119

getContent

public String getContent()

获取内容。

Returns the content.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:121–123

setContent

public void setContent(String content)

设置内容。

Sets the content.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。The content.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:125–127

getContentLtks

public String getContentLtks()

获取 getContentLtks。

Returns the content ltks.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:129–131

setContentLtks

public void setContentLtks(String contentLtks)

设置 setContentLtks。

Sets the content ltks.

参数Parameters
名称Name类型Type说明Description
contentLtksString内容 Ltks(类型 `String`)。The content ltks.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:133–135

getHighlight

public String getHighlight()

获取 getHighlight。

Returns the highlight.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:137–139

setHighlight

public void setHighlight(String highlight)

设置 setHighlight。

Sets the highlight.

参数Parameters
名称Name类型Type说明Description
highlightStringhighlight(类型 `String`)。The highlight.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:141–143

getDocumentId

public String getDocumentId()

获取文档标识。

Returns the document id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:145–147

setDocumentId

public void setDocumentId(String documentId)

设置文档标识。

Sets the document id.

参数Parameters
名称Name类型Type说明Description
documentIdString文档标识(类型 `String`)。The document id.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:149–151

getDocumentKeyword

public String getDocumentKeyword()

获取 getDocumentKeyword。

Returns the document keyword.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:153–155

setDocumentKeyword

public void setDocumentKeyword(String documentKeyword)

设置 setDocumentKeyword。

Sets the document keyword.

参数Parameters
名称Name类型Type说明Description
documentKeywordString文档 Keyword(类型 `String`)。The document keyword.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:157–159

getKbId

public String getKbId()

获取知识库标识。

Returns the kb id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:161–163

setKbId

public void setKbId(String kbId)

设置知识库标识。

Sets the kb id.

参数Parameters
名称Name类型Type说明Description
kbIdString知识库标识(类型 `String`)。The kb id.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:165–167

getSimilarity

public Double getSimilarity()

获取 getSimilarity。

Returns the similarity.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:169–171

setSimilarity

public void setSimilarity(Double similarity)

设置 setSimilarity。

Sets the similarity.

参数Parameters
名称Name类型Type说明Description
similarityDoublesimilarity(类型 `Double`)。The similarity.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:173–175

getVectorSimilarity

public Double getVectorSimilarity()

获取 getVectorSimilarity。

Returns the vector similarity.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:177–179

setVectorSimilarity

public void setVectorSimilarity(Double vectorSimilarity)

设置 setVectorSimilarity。

Sets the vector similarity.

参数Parameters
名称Name类型Type说明Description
vectorSimilarityDouble向量 Similarity(类型 `Double`)。The vector similarity.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:181–183

getTermSimilarity

public Double getTermSimilarity()

获取 getTermSimilarity。

Returns the term similarity.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:185–187

setTermSimilarity

public void setTermSimilarity(Double termSimilarity)

设置 setTermSimilarity。

Sets the term similarity.

参数Parameters
名称Name类型Type说明Description
termSimilarityDoubleterm Similarity(类型 `Double`)。The term similarity.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:189–191

getPositions

public List<List<Integer>> getPositions()

获取 getPositions。

Returns the positions.

返回Returns List<List<Integer>>
返回列出>。Returns list.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:193–195

setPositions

public void setPositions(List<List<Integer>> positions)

设置 setPositions。

Sets the positions.

参数Parameters
名称Name类型Type说明Description
positionsList<List<Integer>>positions(类型 `List >`)。The positions.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:197–199

getImageId

public String getImageId()

获取图像标识。

Returns the image id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:201–203

setImageId

public void setImageId(String imageId)

设置图像标识。

Sets the image id.

参数Parameters
名称Name类型Type说明Description
imageIdString图像标识(类型 `String`)。The image id.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:205–207

getImportantKeywords

public List<String> getImportantKeywords()

获取 getImportantKeywords。

Returns the important keywords.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:209–211

setImportantKeywords

public void setImportantKeywords(List<String> importantKeywords)

设置 setImportantKeywords。

Sets the important keywords.

参数Parameters
名称Name类型Type说明Description
importantKeywordsList<String>important Keywords(类型 `List`)。The important keywords.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:213–215

getMetadata

public Map<String, Object> getMetadata()

获取元数据。

Returns the metadata.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:217–219

setMetadata

public void setMetadata(Map<String, Object> metadata)

设置元数据。

Sets the metadata.

参数Parameters
名称Name类型Type说明Description
metadataMap<String, Object>元数据(类型 `Map`)。The metadata.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:221–223

getDatasetId

public String getDatasetId()

获取 getDatasetId。

Returns the dataset id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:226–229

setDatasetId

public void setDatasetId(String datasetId)

设置 setDatasetId。

Sets the dataset id.

参数Parameters
名称Name类型Type说明Description
datasetIdStringdataset 标识(类型 `String`)。The dataset id.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:231–233

getDocumentName

public String getDocumentName()

获取文档名称。

Returns the document name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:235–238

setDocumentName

public void setDocumentName(String documentName)

设置文档名称。

Sets the document name.

参数Parameters
名称Name类型Type说明Description
documentNameString文档名称(类型 `String`)。The document name.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:240–242

getScore

public Double getScore()

获取分数。

Gets the similarity score.

返回Returns Double
返回数值结果。the similarity score (0.0-1.0), or null if not available
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:252–255

setScore

public void setScore(Double score)

设置分数。

Sets the score.

参数Parameters
名称Name类型Type说明Description
scoreDouble分数(类型 `Double`)。The score.
源码Source io/agentscope/core/rag/integration/ragflow/model/RAGFlowChunk.java:257–259
基于官方固定版本源码静态生成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.