AS AgentScopeAPI 手册 / API Reference

ResponseDataDeserializer

public class ResponseDataDeserializer extends JsonDeserializer<RAGFlowResponse.ResponseData>
源码Source io/agentscope/core/rag/integration/ragflow/model/ResponseDataDeserializer.java:46–94

用于RAGFlow ResponseData的自定义反序列化器。位于 io.agentscope.core.rag.integration.ragflow.model 包,继承自 JsonDeserializer<RAGFlowResponse.ResponseData>。核心成员包括 deserialize。

Custom deserializer for RAGFlow ResponseData.

RAGFlow API may return "data": false or "data": null in some cases (e.g., errors, no results). This deserializer handles those cases gracefully by returning null instead of throwing an exception.

API Response Examples:

`// Success case
{"code": 0, "data": {"chunks": [...], "total": 1}}

// Error or empty case
{"code": 404, "message": "Dataset not found", "data": false}
{"code": 0, "message": "No results", "data": null}
`

方法摘要Method Summary

方法Method说明Description
public RAGFlowResponse.ResponseData deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
执行 `deserialize` 方法。
Performs the deserialize operation.

方法详情Method Detail

deserialize

public RAGFlowResponse.ResponseData deserialize(JsonParser p, DeserializationContext ctxt) throws IOException

执行 deserialize 方法。

Performs the deserialize operation.

参数Parameters
名称Name类型Type说明Description
pJsonParserp(类型 `JsonParser`)。The p.
ctxtDeserializationContextctxt(类型 `DeserializationContext`)。The ctxt.
返回Returns RAGFlowResponse.ResponseData
返回RAGFlowResponse.ResponseData。Returns RAG flow response response data.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/rag/integration/ragflow/model/ResponseDataDeserializer.java:48–93
基于官方固定版本源码静态生成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.