Recursively strip /workspace/ prefix from path values in results.
(obj)
| 64 | |
| 65 | |
| 66 | def _strip_workspace_prefix(obj): |
| 67 | """Recursively strip /workspace/ prefix from path values in results.""" |
| 68 | if isinstance(obj, dict): |
| 69 | return { |
| 70 | k: _strip_path_value(v) if _is_path_key(k) else _strip_workspace_prefix(v) |
| 71 | for k, v in obj.items() |
| 72 | } |
| 73 | elif isinstance(obj, list): |
| 74 | return [_strip_workspace_prefix(item) for item in obj] |
| 75 | return obj |
| 76 | |
| 77 | |
| 78 | # Approximate chars-per-token used for budget conversion. |
no test coverage detected