No project description provided
Project description
CodeRefineAI
Can LLM's identify and remove Software Inefficiencies?
Overview
CodeRefineAI is a project aimed at leveraging Large Language Models (LLMs) to identify and remove software inefficiencies. The project includes a code execution framework that allows for the submission and validation of code snippets using the Judge0 API.
Features
- Code Execution: Submit and execute code snippets using the Judge0 API.
- Template-Based Execution: Execute code using predefined templates.
- Direct Code Execution: Execute entire code snippets directly without templates.
- Submission Details: Retrieve detailed information about code submissions.
Installation
To install the CodeRefineAI package, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/CodeRefineAI.git cd CodeRefineAI
-
Install the package:
pip install .
Usage
Example: Template-Based Execution
from coderefineai_executor import Executor,load_settings
# Example settings
settings = load_settings("/path/to/your/.env")
# Create an instance of Executor
executor = Executor(settings)
# Example metadata
metadata = pd.Series({
"question_id": 1,
"name": "Example Question",
"setup_code": "class TestCaseGenerator: ...",
"entry_point": "main",
"import_code": "import sys",
"test_cases": [{"input": "1 2", "output": "3"}]
})
# Execute the code
response = executor.execute(
code_template="def {entry_point}():\n {import_code}\n {solution_code}\n {test_case_code}",
solution_code="print('Hello, world!')",
metadata=metadata
)
print(response)
Example: Direct Code Execution
from coderefineai_executor import Executor,load_settings
# Example settings
settings = load_settings("/path/to/your/.env")
executor = Executor(settings)
# Execute the code
response = executor.execute_code(
code="print('Hello, world!')",
test_cases="",
expected_results="Hello, world!",
)
# Print the response for debugging purposes
print(response)
Configuration
The Settings class is used to configure the Executor. Here is an example configuration:
from core.executor.config import Settings
settings = Settings(
judge0_base_url="https://api.judge0.com",
judge0_api_key="your_api_key",
self_hosted=False,
num_runs=1
)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Contact
For any questions or inquiries, please contact the very handsome harish876.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 coderefineai_executor-0.1.4-py3-none-any.whl.
File metadata
- Download URL: coderefineai_executor-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d5ca1ded6eeff0901de1679d3c60302ae9a3fa549d48b9d3a6d53a32b59e154
|
|
| MD5 |
d0e98e56331eda7be76c12ae35f4342f
|
|
| BLAKE2b-256 |
bbe474e83d58189ccf1054d5bc00e4f3152f2ab7a785222f3bff8d6c9778f028
|