Skip to content

phuvinhnguyen/Repeton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repeton

Repeton is an AI-powered agent designed for automated code patching and testing. It uses advanced language models to analyze code issues, generate patches, and validate fixes through automated testing.

Features

  • Automated code analysis and problem identification
  • Intelligent patch generation
  • Automated test script creation and execution
  • Support for multiple AI backends (GPT, Gemini, HuggingFace)
  • Comprehensive logging and result tracking

Installation

  1. Install the required dependencies:
pip install FlowDesign
pip install -e .
  1. Set up your API keys: Create a .env file in your project root with the following variables:
OPENAI_API_KEY=your_openai_key
GOOGLE_API_KEY=your_google_key
HUGGINGFACE_API_KEY=your_huggingface_key

Usage

Basic Usage

from Repeton.agentv1 import RepetonAgentv1
from FlowDesign.chatbot import ChatGPTbot

# Initialize the chatbot
bot = ChatGPTbot(api_key="your_openai_key")

# Create the agent
agent = RepetonAgentv1(
    chatbot=bot,
    max_env_response=7000,
    log_path='./log/history'
)

# Process a problem
result = agent({
    'problem': 'Your problem description here',
    'root': '/path/to/project',
    'env': 'python'
})

Command Line Interface

The project includes a command-line interface for running experiments:

# Using GPT
python -m Repeton.experiments.swelite --token YOUR_API_KEY --gpt --name gpt-4

# Using Gemini
python -m Repeton.experiments.swelite --token YOUR_API_KEY --gemini --name gemini-pro

# Using HuggingFace
python -m Repeton.experiments.swelite --token YOUR_API_KEY --hg --name model-name

# Using other APIs with GPT style
python -m Repeton.experiments.swelite --token YOUR_API_KEY --free --name model-name

Options

  • --token: Authentication token for the API
  • --gpt: Use GPT API
  • --free: Use other APIs with GPT style
  • --gemini: Use Gemini API
  • --hg: Use HuggingFace API
  • --fnc_call: Use built-in function-call
  • --name: Model name
  • --base_url: Base URL for API call (You can specify this in case you want to use some models like DeepSeekR1)
  • --local: Save results locally

Project Structure

Repeton/
├── agentv1.py          # Main agent implementation
├── atom.py            # Core patching functionality
├── tester.py          # Testing functionality
├── tools.py           # Utility functions
├── experiments/       # Experiment scripts
│   └── swelite.py     # Main experiment runner
└── tests/            # Test cases

How It Works

  1. Problem Analysis: The agent analyzes the reported problem and project structure
  2. Test Generation: Creates a test script to reproduce the issue
  3. Patch Generation: Generates potential fixes for the identified problem
  4. Validation: Tests the generated patches against the test script
  5. Iteration: Refines the solution if needed

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • FlowDesign for the core processing framework
  • OpenAI, Google, and HuggingFace for their AI models

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors