Extract XML content from a text response. Extracts XML content between ```xml markers. Returns the full response if no XML blocks found. Args: response (str): The text response containing XML content Returns: str: The extracted XML content, or the full response if no X
(response: str)
| 112 | return text |
| 113 | |
| 114 | def extract_xml(response: str) -> str: |
| 115 | """Extract XML content from a text response. |
| 116 | |
| 117 | Extracts XML content between ```xml markers. Returns the full response if no XML blocks found. |
| 118 | |
| 119 | Args: |
| 120 | response (str): The text response containing XML content |
| 121 | |
| 122 | Returns: |
| 123 | str: The extracted XML content, or the full response if no XML blocks found |
| 124 | """ |
| 125 | try: |
| 126 | return re.search(r'```xml\n(.*?)\n```', response, re.DOTALL).group(1) |
| 127 | except: |
| 128 | return response |
no outgoing calls
no test coverage detected