espnet3.bin.atlas.stages.write_files.parse_file_blocks
Less than 1 minute
espnet3.bin.atlas.stages.write_files.parse_file_blocks
espnet3.bin.atlas.stages.write_files.parse_file_blocks(text: str) → list[tuple[str, str]]
Extract every <file path="...">content</file> block from agent output.
- Parameters:text – Agent response text, possibly containing one or more
<file>blocks interleaved with other prose. - Returns:
(relative_path, content)pairs, in the order they appear intext. - Return type: list[tuple[str, str]]
Example
>>> parse_file_blocks('<file path="src/a.py">x = 1</file>')
[('src/a.py', 'x = 1')]