A multi-provider Python code execution and dependency management agent
Project description
🚀 CodeAgent
Automate code generation, execution, and debugging for your projects using LLM-powered agents.
Supports multiple providers (Proplexity, Gemini, and more), multimodal input, and dependency management.
📦 Installation
Install from PyPI:
pip install c4agent
Or install from source:
git clone https://github.com/yourusername/CodeAgent.git
cd CodeAgent
pip install -r requirements.txt
⚡ Quick Start
Initialize Agent
from Agent.CodeAgent import CodeAgent # v1
from Agent.CodeAgentV2 import CodeAgent # v2
from Agent.CodeAgentV3 import CodeAgent # v3
# Example: Initialize with Proplexity API
agent = CodeAgent("<apikey>")
🧑💻 Versions
CodeAgent V1
- Generates & runs Python projects
- Provider: "proplexity"
CodeAgent V2
- Generates & runs Python projects
- Providers: "proplexity", "gemini"
- Dependency Manager included
CodeAgent V3
- Generates & runs Python projects
- Supports multiple providers
- Dependency Manager
- Multimodal input (Text + Images)
✨ Usage
🔹 1. Generate Code from Prompt
agent.generate(
"Explain About Artificial Intelligence"
).json()
🔹 2. Automate Flow - Example Project
prompt = """
You are an AI Agent. You will code like an AI research scientist.
Code For SmolAgents
Instructions:
1. Agent should answer tech-related questions
2. Execution not supported
3. Give only Python code
4. Python only support
5. Should include docstrings
User: Build a multimodal embedding model (Image + Text) using contrastive learning.
Dataset Link and Description:
- Kaggle credentials are already set up
- Dataset: fashion-product-images-small
Load dataset:
```python
!mkdir -p /root/.kaggle
!cp kaggle.json /root/.kaggle
!chmod 600 /root/.kaggle/kaggle.json
!kaggle datasets download paramaggarwal/fashion-product-images-small
Dataset load using Python:
import pandas as pd
df = pd.read_csv("/content/myntradataset/styles.csv", on_bad_lines="skip")
df.head()
Example dataset output:
id gender masterCategory subCategory articleType baseColour season year usage productDisplayName
0 15970 Men Apparel Topwear Shirts Navy Blue Fall 2011.0 Casual Turtle Check Men Navy Blue Shirt
1 39386 Men Apparel Bottomwear Jeans Blue Summer 2012.0 Casual Peter England Men Party Blue Jeans
2 59263 Women Accessories Watches Watches Silver Winter 2016.0 Casual Titan Women Silver Watch
3 21379 Men Apparel Bottomwear Track Pants Black Fall 2011.0 Casual Manchester United Men Solid Black Track Pants
4 53759 Men Apparel Topwear Tshirts Grey Summer 2012.0 Casual Puma Men Grey T-shirt
Model Requirements:
- Use HuggingFace pretrained BERT and ViT models
- Train using contrastive learning
- Use Torch and optionally LangChain
- Save best model & logs
- Include evaluation, testing, and CUDA support
- Progress bar using tqdm
- Provide full final code """
Run the agent
agent(prompt)
### 🔹 3. V3 Multimodal Example
```python
agent = CodeAgent(
gemini_apikey="<apikey>",
provider="gemini"
)
result = agent({
"text": "Write a Python script to save a plot in ./plot.png",
"images": ["/content/Loss.png", "/content/Accuracy.png"]
})
print(result)
📂 Outputs are stored in local folders.
📑 Example Output
When running prompts, CodeAgent will:
- ✅ Generate full Python code
- ✅ Manage dependencies
- ✅ Save outputs & logs locally
- ✅ Handle debugging & execution automatically
🔧 Requirements
- Python 3.8+
- Dependencies (auto-installed with
pip install c4agent)
📌 Roadmap
- Support Proplexity provider
- Add Gemini provider
- Dependency manager
- Multimodal input (text + images)
- Add more providers (OpenAI, Claude, etc.)
- CLI support
- Web UI for interactive coding
🤝 Contributing
Contributions are welcome!
- Fork the repo
- Create your feature branch (
git checkout -b feature/awesome-feature) - Commit changes (
git commit -m 'Add awesome feature') - Push to branch (
git push origin feature/awesome-feature) - Open a Pull Request
📜 License
MIT License © 2025
🌟 Support
If you like this project, please ⭐ the repo to support development!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file c4agent-0.1.tar.gz.
File metadata
- Download URL: c4agent-0.1.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
018a4cd2378bcdadef2554a2959c3fd013f894c3f09a7d2852b86c4bd04e91f1
|
|
| MD5 |
e6c3810b6200674ad0748b75be966e49
|
|
| BLAKE2b-256 |
d9dd38f73c82afd972367fefe04d05f6757c350ab224ad2711b197b04990d764
|
File details
Details for the file c4agent-0.1-py3-none-any.whl.
File metadata
- Download URL: c4agent-0.1-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13297b237a3afbb29202fc8407883ce4a0b7980963765ead9dc385eee8271143
|
|
| MD5 |
d5756044adca65257819e049f259380f
|
|
| BLAKE2b-256 |
cdc3846de94501f08b983ec4a312f6e888c10702db0b7043b04e6421eb3de9c7
|