MCPcopy Create free account
hub / github.com/OpenBMB/ToolBench / to_json_recursive

Method to_json_recursive

toolbench/inference/Tree/Tree.py:13–20  ·  view source on GitHub ↗
(self,use_messages=False)

Source from the content-addressed store, hash-verified

11
12
13 def to_json_recursive(self,use_messages=False):
14 tree_structure = self.root.to_json_recursive(use_messages=use_messages)
15 js_obj = {
16 "size": self.root.get_size(),
17 "max_length":self.root.get_max_depth(),
18 "tree": tree_structure,
19 }
20 return js_obj
21
22
23class tree_node:

Callers 2

to_jsonMethod · 0.45
to_json_recursiveMethod · 0.45

Calls 2

get_sizeMethod · 0.80
get_max_depthMethod · 0.80

Tested by

no test coverage detected