Skip to main content

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

Constructor

str
default:"'CodeAgent'"
No description available.
Optional[str]
No description available.
Optional
No description available.
Optional[str]
No description available.
bool
default:"True"
No description available.

Methods

console()

Lazy load Rich console.

litellm()

Lazy load litellm.

generate()

Generate code from natural language description.

generate_code()

Alias for generate() method.

agenerate()

Generate code asynchronously.

execute()

Execute code in sandboxed environment.

execute_code()

Alias for execute() method.

aexecute()

Execute code asynchronously.

review()

Review code for issues, bugs, and improvements.

explain()

Explain what code does in plain language.

refactor()

Refactor code to improve quality.

fix()

Fix bugs in code.

Usage

Source

View on GitHub

praisonaiagents/agent/code_agent.py at line 32

Agents Concept

Single Agent Guide

Multi-Agent Guide

Agent Configuration

Auto Agents