Code Agent • Rust AI Agent SDK
CodeAgent: A specialized agent for code generation and execution.
CodeAgent
Defined in the agents module.
Rust AI Agent SDK
A specialized agent for code generation and execution.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
input["Input Data"] --> agent["Agent: CodeAgent"]
agent --> output["Output Result"]
style agent fill:#8B0000,color:#fff
style input fill:#8B0000,color:#fff
style output fill:#8B0000,color:#fffFields
| Name | Type | Description |
|---|---|---|
name | String | Agent name |
model | String | LLM model |
config | CodeConfig | Code configuration |
instructions | Option<String> | System instructions |
verbose | bool | Verbose output |
Methods
new
fn new() -> CodeAgentBuilderCreate a new CodeAgent builder
name
fn name(&self) -> &strGet agent name
generate
fn generate(&self, description: &str) -> Result<String>Generate code from a description (placeholder)
Parameters:
| Name | Type |
|---|---|
description | &str |
execute
fn execute(&self, _code: &str) -> Result<CodeExecutionResult>Execute code (placeholder – would require sandbox)
Parameters:
| Name | Type |
|---|---|
_code | &str |
review
fn review(&self, code: &str) -> Result<String>Review code (placeholder)
Parameters:
| Name | Type |
|---|---|
code | &str |
Source
View on GitHubpraisonai/src/agents/mod.rs at line 776