Skip to content

Commit e5afc13

Browse files
committed
feat: update result json parser
1 parent a0abdd7 commit e5afc13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/memos/mem_reader/simple_struct.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ def _process_doc_data(self, scene_data_info, info):
229229

230230
def parse_json_result(self, response_text):
231231
try:
232-
response_text = response_text.replace("```", "").replace("json", "")
233-
response_text = re.sub(r"<think>.*?</think>", "", response_text).strip()
232+
json_start = response_text.find("{")
233+
response_text = response_text[json_start:]
234+
response_text = response_text.replace("```", "").strip()
234235
if response_text[-1] != "}":
235236
response_text += "}"
236237
response_json = json.loads(response_text)

0 commit comments

Comments
 (0)