MCPcopy
hub / github.com/showlab/Code2Video / extract_answer_from_response

Function extract_answer_from_response

src/utils.py:19–28  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

17
18
19def extract_answer_from_response(response):
20 try:
21 content = response.candidates[0].content.parts[0].text
22 except Exception:
23 try:
24 content = response.choices[0].message.content
25 except Exception:
26 content = str(response)
27 content = extract_json_from_markdown(content)
28 return content
29
30
31def fix_png_path(code_str: str, assets_dir: Path) -> str:

Callers 4

_call_text_apiFunction · 0.90
_call_video_apiFunction · 0.90
get_mllm_feedbackMethod · 0.85

Calls 1

Tested by

no test coverage detected