Extract content from XML tags.
(text: str, tag: str)
| 77 | |
| 78 | |
| 79 | def extract_xml_content(text: str, tag: str) -> str | None: |
| 80 | """Extract content from XML tags.""" |
| 81 | pattern = rf"<{tag}>(.*?)</{tag}>" |
| 82 | matches = re.findall(pattern, text, re.DOTALL) |
| 83 | return matches[-1].strip() if matches else None |
| 84 | |
| 85 | |
| 86 | async def agent_loop( |
no outgoing calls
no test coverage detected