(self,single_chain_max_step,pass_at=1,answer=1)
| 70 | return json_obj |
| 71 | |
| 72 | def start(self,single_chain_max_step,pass_at=1,answer=1): |
| 73 | self.forward_args = locals() |
| 74 | if "self" in self.forward_args.keys(): |
| 75 | self.forward_args.pop("self") |
| 76 | |
| 77 | for i in range(pass_at): |
| 78 | if self.process_id == 0: |
| 79 | print(f"[single_chain]try for the {i+1} time") |
| 80 | self.tree = my_tree() |
| 81 | self.tree.root.node_type = "Action Input" |
| 82 | self.tree.root.io_state = deepcopy(self.io_func) |
| 83 | out_node = self.do_chain(self.tree.root, single_chain_max_step) |
| 84 | self.terminal_node.append(out_node) |
| 85 | self.try_list.append(self.to_json_single()) |
| 86 | if out_node.io_state.check_success() == 1: |
| 87 | self.status = 1 |
| 88 | self.success_count += 1 |
| 89 | if self.success_count >= answer: |
| 90 | return 1 |
| 91 | return 0 |
| 92 | |
| 93 | |
| 94 | def do_chain(self,now_node,single_chain_max_step): |
nothing calls this directly
no test coverage detected