From 42da3b1fe8e2200338b5ad476ca4193e2b1d3e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Mon, 12 Aug 2024 20:28:50 +0800 Subject: [PATCH] update annotations --- metagpt/utils/repair_llm_raw_output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metagpt/utils/repair_llm_raw_output.py b/metagpt/utils/repair_llm_raw_output.py index f1607255e..2015b2ed7 100644 --- a/metagpt/utils/repair_llm_raw_output.py +++ b/metagpt/utils/repair_llm_raw_output.py @@ -352,7 +352,7 @@ def extract_state_value_from_output(content: str) -> str: def repair_escape_error(commands): """ Repaires escape errors in command responses. - When role-zero parses a command, the command may contain unknown escape characters. + When RoleZero parses a command, the command may contain unknown escape characters. This function has two steps: 1. Transform unescaped substrings like "\d" and "\(" to "\\\\d" and "\\\\(". @@ -362,7 +362,7 @@ def repair_escape_error(commands): When the original JSON string is " {"content":"\\\\( \\\\frac{1}{2} \\\\)"} ", The "content" will be parsed correctly to "\( \frac{1}{2} \)". - When there is a wrong JSON string like: " {"content":"\( \frac{1}{2} \)"}", + However, if the orginal JSON string is " {"content":"\( \frac{1}{2} \)"}" directly. It will cause a parsing error. To repair the wrong JSON string, the following transformations will be used: