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

Method print

toolbench/inference/Tree/Tree.py:88–97  ·  view source on GitHub ↗
(self,process_id = 0)

Source from the content-addressed store, hash-verified

86 child.prune()
87
88 def print(self,process_id = 0):
89 if process_id != 0:
90 return
91 color_converter = {"Thought":"red", "Action": "blue", "Action Input": "cyan","Final Answer": "green","Reflection":"blue"}
92 print(colored(f"{self.node_type}: {self.description}",color = color_converter[self.node_type]))
93 if self.observation != "":
94 if len(self.observation) < 1536:
95 print(colored(f"Observation: {self.observation}",color="yellow"))
96 else:
97 print(colored(f"Observation: {self.observation[:1536]}......(len={len(self.observation)})",color="yellow"))
98
99
100 @classmethod

Callers 2

DFSMethod · 0.80
do_chainMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected