generate_bugfix_refactor
Fix or refactor code by generating corrected or improved implementations from current code, problem, expected behavior, and test cases; optionally co-generate unit tests.
Instructions
Generate fixed or refactored code (Template 3) using coder expert model.
If generate_test_file is True, it will co-generate a matching unit test suite.
IMPORTANT: All parameters (such as 'task', 'problem', 'expected_behavior', 'constraints', etc.) MUST be provided in English. If the user's prompt or request is in Vietnamese or another language, the calling agent must automatically translate the text of these parameter values into English before invoking this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | ||
| problem | Yes | ||
| language | Yes | ||
| test_cases | Yes | ||
| constraints | No | ||
| current_code | Yes | ||
| expected_behavior | Yes | ||
| generate_test_file | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |