MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / get_json_from_response

Function get_json_from_response

utils/src/utils.py:121–131  ·  view source on GitHub ↗
(raw_response: str)

Source from the content-addressed store, hash-verified

119
120
121def get_json_from_response(raw_response: str):
122 response = raw_response.strip()
123 l, r = response.rfind("```json"), response.rfind("```")
124 try:
125 if l == -1 or r == -1:
126 response = json_repair.loads(response)
127 else:
128 response = json_repair.loads(response[l + 7 : r].strip())
129 return response
130 except Exception as e:
131 raise RuntimeError("Failed to parse JSON from response", e)
132
133
134tenacity = retry(

Callers 15

eval_qa_get_answerFunction · 0.90
get_questionsFunction · 0.90
eval_vlm_as_judge_aspectFunction · 0.90
no_tree_get_layoutFunction · 0.90
__call__Method · 0.90
__post_process__Method · 0.90
gen_poster_title_contentFunction · 0.90
_process_sectionFunction · 0.90
filter_image_tableFunction · 0.90
gen_outline_layout_v2Function · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected