1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package tech.aiflowy.ai.node;
 
import com.agentsflex.core.chain.ChainNode;
import com.alibaba.fastjson.JSONObject;
import dev.tinyflow.core.Tinyflow;
import dev.tinyflow.core.parser.BaseNodeParser;
 
public class DocNodeParser extends BaseNodeParser {
 
    private final ReadDocService readDocService;
 
    public DocNodeParser(ReadDocService readDocService) {
        this.readDocService = readDocService;
    }
 
    @Override
    public ChainNode parse(JSONObject jsonObject, Tinyflow tinyflow) {
        JSONObject data = getData(jsonObject);
        DocNode docNode = new DocNode(readDocService);
        addParameters(docNode, data);
        addOutputDefs(docNode, data);
        return docNode;
    }
 
    public String getNodeName() {
        return "document-node";
    }
}