refactor • AI Agent SDK

refactor: Refactor code to improve quality.

refactor

Method

</div>

This is a method of the CodeAgent class in the code_agent module.

Refactor code to improve quality.

Signature

python
def refactor(code: str, instructions: str, language: str) -> str

Parameters

ParamField str

Code to refactor

ParamField str

Specific refactoring instructions

ParamField str

Programming language **kwargs: Additional arguments

Returns

ResponseField str

Refactored code as string

Uses

  • completion
  • ValueError

Source

View on GitHub

praisonaiagents/agent/code_agent.py at line 386