While there exists the API for creating a dialogue tree, adding and connecting nodes, unfortunately because creating dialogue trees in runtime was not taken into consideration (since it defies the need of a node editor 🙂 ), most of the fields (like for example in StatementNode) are private. With that said, I could make them public in a future version though if that is something required.
Here is how you would create a dialogue tree controller, a simple dialogue tree with two nodes, and assigning it to the controller.
As mentioned earlier though, the StatementNode.statement field is private, thus not much of a use, unless it is made public, so that it is possible to set the statement (the dialogue to be displayed, which is called a “statement” in NodeCanvas).