Skip to content

Commit a96c4ca

Browse files
committed
w -> __extract_json_from_text
1 parent b745916 commit a96c4ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patchwork/steps/SimplifiedLLM/SimplifiedLLM.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __json_loads(json_str: str) -> dict:
5757
raise e
5858

5959
@staticmethod
60-
def w(text: str) -> str:
60+
def __extract_json_from_text(text: str) -> str:
6161
try:
6262
start = text.find("{")
6363
end = text.rfind("}")
@@ -79,7 +79,7 @@ def __retry_unit(self, prepare_prompt_outputs, call_llm_inputs, retry_data: Retr
7979
try:
8080
# For models that don't support JSON mode, extract JSON from the text response first
8181
if self.is_json_mode_unsupported:
82-
response = self.w(response)
82+
response = self.__extract_json_from_text(response)
8383

8484
json_response = self.__json_loads(response)
8585
json_responses.append(json_response)

0 commit comments

Comments
 (0)