Skip to main content

A PMAgent is an Expert Technical Professional with comprehensive knowledge across multiple domains including Full Stack Development, Data Science, Data Analysis, DevOps, and Machine Learning.

Project description

PMAgent

PMAgent is a Python package that helps developers, data scientists, and DevOps professionals to refactor and modify code using OpenAI/Groq. It reads code from files, interacts with an LLM to generate modifications, and saves changes back to the files. It can create new projects in any programming language with just a prompt.

Installation

pip install PMAgent

Environment Setup

# API Keys (at least one is required)
export OPENAI_API_KEY="sk-..."
export GROQ_API_KEY="gsk_..."

# Optional Configuration
export MODEL=""        # Specific model to use
export TEMPERATURE=""  # Temperature for response generation
export TOP_P=""       # Top-p sampling parameter
export MAX_TOKENS=""  # Maximum tokens in response

Basic Usage

pmagent <UserPrompt> <directorytoexecute>

Parameters:

  • UserPrompt: Your instruction or request in quotes
  • directorytoexecute: Path to the target directory (optional)
  • --llm-type or -l: Choose LLM provider (openai or groq) (optional)

Examples

1. Web Development Projects

# Create a new React e-commerce project
pmagent "Create a React e-commerce website with product listing, cart functionality, and checkout process" ecommerce-app

# Build a portfolio website
pmagent "Create a modern portfolio website with dark/light mode, project showcase, and contact form" portfolio-site

# Create a dashboard
pmagent "Build a responsive admin dashboard with charts, tables, and user management" admin-dashboard

2. Data Science & Analysis

# Create data analysis notebook
pmagent "Create a comprehensive EDA notebook for customer churn analysis including visualizations" churn-analysis

# Build ML pipeline
pmagent "Create a machine learning pipeline for house price prediction with data preprocessing and model evaluation" ml-pipeline

# Time series analysis
pmagent "Set up a time series analysis project for stock price prediction with LSTM" stock-analysis

3. Backend Development

# Create API server
pmagent "Create a FastAPI backend with user authentication, database models, and CRUD operations" backend-api

# Setup microservices
pmagent "Set up a microservices architecture with user service and product service using Docker" microservices

# Create CLI tool
pmagent "Create a Python CLI tool for automated file organization with logging" file-organizer

4. DevOps & Infrastructure

# Setup CI/CD pipeline
pmagent "Create GitHub Actions workflow for testing and deploying a Python package" cicd-setup

# Infrastructure as Code
pmagent "Create Terraform configuration for AWS ECS cluster with auto-scaling" terraform-aws

# Docker setup
pmagent "Create Docker configuration for a MERN stack application" docker-config

5. Code Refactoring

# Refactor existing code
pmagent "Refactor the Python code in utils/ to follow SOLID principles" utils

# Add tests
pmagent "Add unit tests for all functions in the services/ directory" services

# Optimize performance
pmagent "Optimize the database queries in the repositories/ folder" repositories

Python API Usage

import os
from pmagent import LLMInteractionManager

def main():
    # Initialize with configuration
    llm_interaction_manager = LLMInteractionManager(
        openai_api_key=os.getenv("OPENAI_API_KEY"), 
        groq_api_key=os.getenv("GROQ_API_KEY"),
        config={   # OPTIONAL 
            "model": "llama-3.1-70b-versatile",
            "temperature": 0.5,
            "top_p": 0.9,
            "max_tokens": 4000,
        },
        llm_type='groq',  # OPTIONAL 
    )

    # Example: Create a new project
    llm_interaction_manager.interact_with_llm(
        user_message="Create a FastAPI backend with SQLAlchemy ORM and JWT authentication",
        path="backend-project"
    )

    # Example: Refactor existing code
    llm_interaction_manager.interact_with_llm(
        user_message="Refactor this code to use dependency injection and add proper error handling",
        path="src/services"
    )

if __name__ == "__main__":
    main()

Best Practices

  1. Clear Instructions: Be specific in your prompts about what you want to create or modify
  2. Directory Structure: Create the target directory before running the command if needed
  3. Version Control: Always commit your changes before using PMAgent for code modifications
  4. API Keys: Use environment variables for API keys instead of hardcoding them
  5. Model Selection: Choose the appropriate model based on your task complexity

Support

For issues, feature requests, or contributions, please visit our GitHub repository.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PMAgent-0.2.10.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

PMAgent-0.2.10-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file PMAgent-0.2.10.tar.gz.

File metadata

  • Download URL: PMAgent-0.2.10.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for PMAgent-0.2.10.tar.gz
Algorithm Hash digest
SHA256 0a89a71e84e853d2698632010b5735813a551261ff17c935189ad14de1d0e567
MD5 42717296dd96337b67c9f96eb58120ea
BLAKE2b-256 6359e5c7cdbb4441369a2db59390bf839901ebaac0c05d6165406b9a5f065927

See more details on using hashes here.

File details

Details for the file PMAgent-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: PMAgent-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for PMAgent-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9b46d2dc1743247737f4e42cc9f98ad0ba413ae99c3a445f07ea05c7a3627af3
MD5 096ef8883437a04f082cc5225e583776
BLAKE2b-256 1b6f0f3b569c375fd39dceacb11444b8df6f180887c7ee75c6333c70c3de0e68

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page