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 |
|---|---|---|
p | JsonParser | p(类型 `JsonParser`)。The p. |
ctxt | DeserializationContext | ctxt(类型 `DeserializationContext`)。The ctxt. |
RAGFlowResponse.ResponseData返回RAGFlowResponse.ResponseData。Returns RAG flow response response data.
IOException可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/core/rag/integration/ragflow/model/ResponseDataDeserializer.java:48–93