From fb69c107feaf866f704299b003072baa3f760ef7 Mon Sep 17 00:00:00 2001 From: better629 Date: Mon, 4 Dec 2023 21:56:43 +0800 Subject: [PATCH] rm useless deepcopy --- metagpt/utils/repair_llm_raw_output.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metagpt/utils/repair_llm_raw_output.py b/metagpt/utils/repair_llm_raw_output.py index f9e6d020d..124bcba89 100644 --- a/metagpt/utils/repair_llm_raw_output.py +++ b/metagpt/utils/repair_llm_raw_output.py @@ -82,8 +82,7 @@ def repair_required_key_pair_missing(output: str, req_key: str = "[/CONTENT]") - if left_key not in output: output = left_key + "\n" + output if right_key not in output: - def judge_potential_json(routput: str, left_key: str) -> Union[str]: - routput = copy.deepcopy(routput) + def judge_potential_json(routput: str, left_key: str) -> Union[str, None]: ridx = routput.rfind(left_key) if ridx < 0: return None