(self, arguments: ToolCallArguments, _path: Path)
| 389 | return self.str_replace(_path, old_str, new_str) |
| 390 | |
| 391 | def _insert_handler(self, arguments: ToolCallArguments, _path: Path) -> ToolExecResult: |
| 392 | insert_line = arguments.get("insert_line") if "insert_line" in arguments else None |
| 393 | if not isinstance(insert_line, int): |
| 394 | return ToolExecResult( |
| 395 | error="Parameter `insert_line` is required and should be integer for command: insert", |
| 396 | error_code=-1, |
| 397 | ) |
| 398 | new_str_to_insert = arguments.get("new_str") if "new_str" in arguments else None |
| 399 | if not isinstance(new_str_to_insert, str): |
| 400 | return ToolExecResult( |
| 401 | error="Parameter `new_str` is required for command: insert", |
| 402 | error_code=-1, |
| 403 | ) |
| 404 | return self._insert(_path, insert_line, new_str_to_insert) |
| 405 | |
| 406 | |
| 407 | def main(): |
no test coverage detected