(response)
| 17 | |
| 18 | |
| 19 | def 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 | |
| 31 | def fix_png_path(code_str: str, assets_dir: Path) -> str: |
no test coverage detected