A multi-provider Python code execution and dependency management agent
Project description
CodeAgent
Help To Automate Code For Your Projects Using LLM
Install Dependency
pip install -r requirements.txt
Initize Agent Using Proplexity API
from CodeAgent import CodeAgent
from CodeAgentV2 import CodeAgent
from CodeAgentV3 import CodeAgent
agent = CodeAgent("<apikey>")
if code agent v1 is just generate and run python project (provider="proplexity") if code agent v2 is just generate and run python project (provider="proplexity","gemini") (dependency Manager) if code agent v2 is just generate and run python project (provider=multiple providers) (dependency Manager) (multimodal also)
Just Generate Using Prompt
agent.generate(
"Explain About Artificial Intelligence"
).json()
To Automate Flow - Example Project
prompt = """
You are Ai Agent . You will able to code like ai research scientist
Code For SmolAgents
Instructions :
1) Agent should answer tech related questions
2) Execution not supported
3) Give only Code
4) python only support
5) Should Consider doc string
user: Building embedding model using contrastive learning . MultiModal embedding model ( Image + Text)
Dataset Link and Description :
Kaggle creadiential also settled up and
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()
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
Use HuggingfacePretrained Bert and VIT model for embedding model and Use Torch and langchain(if needed)
Embedding Model Train Using Contrastive Learning with Evaluation and Testing
Save Best Model and load it for inference Then Save Log File also
Progress bar using tqdm and cuda support
Give me a full final code
"""
To Start Runing And Bebugging
agent(prompt)
To V3 Version:
agent = CodeAgent(
gemini_apikey="AIzaSyDebfxNkbpWrQ7wRmdvxt53_uikm1-ZySU",
provider= "gemini"
)
result = agent({
"text": "Write a Python script to plot.save in ./plot.png",
"images": ["/content/Loss.png","/content/Accuracy.png"]
})
print(result)
*** outputs are Stored Local Folders ***
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.2.tar.gz.
File metadata
- Download URL: c4agent-0.1.2.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
025fbb5d703ccb48e1e1517c93f0d8ca5388dfed30733c3e30e3e13c686381d1
|
|
| MD5 |
444610ff2f2389d76722a764ed4004c5
|
|
| BLAKE2b-256 |
752756696d21340d8881d38f37318581ea0a4377788bf0cfa20a39cc26581a9c
|
File details
Details for the file c4agent-0.1.2-py3-none-any.whl.
File metadata
- Download URL: c4agent-0.1.2-py3-none-any.whl
- Upload date:
- Size: 22.0 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 |
5da68ec99fc5f8666653d9d5c9ebab35c24cc4fc0807f186e681ef3823d5a232
|
|
| MD5 |
b0cc34f04c1a27f20807cc16157251c4
|
|
| BLAKE2b-256 |
d54678b998eada9d463360ee831953e0edea96df3a52c86f9825188fa84f1dca
|