Optimize Source Code
generate-code-optimizationUse this when the user supplies source code and asks for an optimized or refactored version. After authorization, this state-changing action consumes AI credits, creates a generation, and returns the revised code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional custom name used to identify the optimized code in generation history | |
| filename | Yes | The full file path of the file being optimized (e.g., src/utils/helper.ts) | |
| source_code | Yes | The source code to optimize | |
| optimization_focus | No | Focus area for optimization (default: Performance) | |
| additional_instructions | No | Additional instructions for code optimization |