(assistant_message_content)
| 93 | |
| 94 | |
| 95 | def extract_json_str_from_markdown(assistant_message_content) -> str: |
| 96 | matches = re.findall(r"```([\s\S]+?)```", assistant_message_content) |
| 97 | |
| 98 | if matches: |
| 99 | code_str = matches[0] |
| 100 | match = re.search(r"(?i)bash\s+(.*)", code_str, re.DOTALL) |
| 101 | if match: |
| 102 | code_str = match.group(1) |
| 103 | else: |
| 104 | code_str = assistant_message_content |
| 105 | |
| 106 | return code_str |
no outgoing calls
no test coverage detected