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.
- 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
- Install the required dependencies:
pip install FlowDesign
pip install -e .- Set up your API keys:
Create a
.envfile 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
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'
})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--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
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
- Problem Analysis: The agent analyzes the reported problem and project structure
- Test Generation: Creates a test script to reproduce the issue
- Patch Generation: Generates potential fixes for the identified problem
- Validation: Tests the generated patches against the test script
- Iteration: Refines the solution if needed
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- FlowDesign for the core processing framework
- OpenAI, Google, and HuggingFace for their AI models