Code Agent • AI Agent SDK

CodeAgent: Agent for code generation, execution, review, and refactoring.

CodeAgent

Defined in the Code Agent module.

AI Agent

Agent for code generation, execution, review, and refactoring.

This agent provides capabilities for:

  • Generating code from natural language descriptions
  • Executing code in a sandboxed environment
  • Reviewing code for issues and improvements
  • Refactoring and fixing code
  • Explaining code functionality
Diagram

Input Data

Agent: CodeAgent

Output Result

Constructor

ParamField str

No description available.

ParamField Optional[str]

No description available.

ParamField Optional[str]

No description available.

ParamField Optional

No description available.

ParamField Optional[str]

No description available.

ParamField bool

No description available.

Methods

Usage

python
from praisonaiagents import CodeAgent

    agent = CodeAgent(name="Coder")

    # Generate code
    code = agent.generate("Write a function to calculate fibonacci")

    # Execute code
    result = agent.execute("print('Hello, World!')")

    # Review code
    review = agent.review(code)

Source

View on GitHub

praisonaiagents/agent/code_agent.py at line 32


Related Documentation