(self)
| 108 | return "\n".join(show_diff) |
| 109 | |
| 110 | def _update_files(self): |
| 111 | name = self.partial_response_function_call.get("name") |
| 112 | if name and name != "write_file": |
| 113 | raise ValueError(f'Unknown function_call name="{name}", use name="write_file"') |
| 114 | |
| 115 | args = self.parse_partial_args() |
| 116 | if not args: |
| 117 | return |
| 118 | |
| 119 | files = args.get("files", []) |
| 120 | |
| 121 | edited = set() |
| 122 | for file_upd in files: |
| 123 | path = file_upd.get("path") |
| 124 | if not path: |
| 125 | raise ValueError(f"Missing path parameter: {file_upd}") |
| 126 | |
| 127 | content = file_upd.get("content") |
| 128 | if not content: |
| 129 | raise ValueError(f"Missing content parameter: {file_upd}") |
| 130 | |
| 131 | if self.allowed_to_edit(path, content): |
| 132 | edited.add(path) |
| 133 | |
| 134 | return edited |
nothing calls this directly
no test coverage detected