replace_function
Replace entire Python function definitions including signature, body, and decorators in one operation. Use when rewriting functions completely, such as renaming with parameter changes.
Instructions
Replace an entire function definition with new content -- signature, body, and decorators.
Use this when: You're rewriting a function top-to-bottom (e.g., renaming it,
changing parameters AND implementation together).
Don't use this when: You only need to change the body -> use replace_function_body.
You only need to change the signature -> use replace_signature.
Example: target="LRUCache.get" content=' def get(self, key, default=None):\n return self.items.get(key, default)'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |