add_method
Add a method to an existing class in code files using AST-based editing for precise modifications.
Instructions
Add a new method at the end of a class body.
Use this when: You're adding a method to an existing class.
Don't use this when: You're adding a field/attribute -> use add_field. You're
adding a top-level function (not inside a class) -> use add_top_level.
Example: class_target="LRUCache" content=' def clear(self):\n self.items.clear()'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| class_target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |