{"id":23431062,"url":"https://github.com/jroakes/geneticml","last_synced_at":"2025-10-29T17:03:11.893Z","repository":{"id":191416558,"uuid":"684577617","full_name":"jroakes/geneticML","owner":"jroakes","description":"Automatically refine Python code to meet specified objectives.","archived":false,"fork":false,"pushed_at":"2023-08-29T13:46:53.000Z","size":22,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T00:46:52.219Z","etag":null,"topics":["genetic-programming","openai-chatgpt"],"latest_commit_sha":null,"homepage":"https://github.com/jroakes","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jroakes.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-29T12:29:17.000Z","updated_at":"2023-11-14T06:03:48.000Z","dependencies_parsed_at":"2023-08-29T21:16:02.560Z","dependency_job_id":null,"html_url":"https://github.com/jroakes/geneticML","commit_stats":null,"previous_names":["jroakes/geneticml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jroakes%2FgeneticML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jroakes%2FgeneticML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jroakes%2FgeneticML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jroakes%2FgeneticML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jroakes","download_url":"https://codeload.github.com/jroakes/geneticML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643873,"owners_count":21138518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genetic-programming","openai-chatgpt"],"created_at":"2024-12-23T09:49:17.354Z","updated_at":"2025-10-29T17:03:11.792Z","avatar_url":"https://github.com/jroakes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeneticML\n\n## Description\n\nGeneticML is a Python project aimed at automatically refining Python code to meet a specified objective. The project uses a large language model to make incremental improvements in the code base and evaluates the changes in a continual testing cycle until the objective is met or found to be unachievable.\n\n# Example Run\n\n```\n(base) C:\\Projects\\geneticML\u003epython geneticML/main.py\n\n🤖: Do you want to restart the configuration? [y/n]: y\n🤖: Please specify the objective:\nProgram that returns the latest stock price of Apple\n\n🤖: Please specify the expected result for this objective:\n180.19\n\n2023-08-29 08:14:47.725 | INFO     | code_manager:initialize_dynamic_main:109 - Initialized dynamic_main\\dynamic_main.py\n2023-08-29 08:15:02.087 | INFO     | code_manager:make_improvements:187 - File: dynamic_main\\dynamic_main.py, Action: edit\n2023-08-29 08:15:12.289 | INFO     | code_manager:objective_is_met:282 - Objective Result:\n2023-08-29 08:15:12.293 | INFO     | __main__:main_loop:69 - Got the following result: An error occurred: 'regularMarketPrice'\nNone\n2023-08-29 08:15:12.295 | INFO     | __main__:main_loop:70 - Got the following error: None\n2023-08-29 08:15:12.297 | INFO     | __main__:main_loop:75 - Objective not met. Making improvements.\n2023-08-29 08:15:20.781 | INFO     | code_manager:make_improvements:187 - File: dynamic_main\\dynamic_main.py, Action: edit\n2023-08-29 08:15:35.007 | INFO     | code_manager:objective_is_met:282 - Objective Result:\n2023-08-29 08:15:35.011 | INFO     | __main__:main_loop:69 - Got the following result: An error occurred: 'regularMarketPrice'\nNone\n2023-08-29 08:15:35.013 | INFO     | __main__:main_loop:70 - Got the following error: None\n2023-08-29 08:15:35.014 | INFO     | __main__:main_loop:75 - Objective not met. Making improvements.\n2023-08-29 08:15:54.276 | INFO     | code_manager:make_improvements:187 - File: dynamic_main\\dynamic_main.py, Action: edit\n2023-08-29 08:16:12.422 | INFO     | code_manager:objective_is_met:282 - Objective Result:\n2023-08-29 08:16:12.427 | INFO     | __main__:main_loop:69 - Got the following result: The key regularMarketPrice does not exist in the stock info.\nNone\n2023-08-29 08:16:12.428 | INFO     | __main__:main_loop:70 - Got the following error: None\n2023-08-29 08:16:12.430 | INFO     | __main__:main_loop:75 - Objective not met. Making improvements.\n2023-08-29 08:16:27.668 | INFO     | code_manager:make_improvements:187 - File: dynamic_main\\dynamic_main.py, Action: edit\n2023-08-29 08:16:40.479 | INFO     | code_manager:objective_is_met:282 - Objective Result:\n2023-08-29 08:16:40.484 | INFO     | __main__:main_loop:69 - Got the following result: 180.19000244140625\n2023-08-29 08:16:40.486 | INFO     | __main__:main_loop:70 - Got the following error: None\n2023-08-29 08:16:40.488 | INFO     | __main__:main_loop:75 - Objective not met. Making improvements.\n2023-08-29 08:16:55.037 | INFO     | code_manager:make_improvements:187 - File: dynamic_main\\dynamic_main.py, Action: edit\n2023-08-29 08:17:08.441 | INFO     | code_manager:objective_is_met:282 - Objective Result:\n2023-08-29 08:17:08.446 | INFO     | __main__:main_loop:69 - Got the following result: 180.19\n2023-08-29 08:17:08.448 | INFO     | __main__:main_loop:70 - Got the following error: None\n2023-08-29 08:17:08.450 | SUCCESS  | __main__:main_loop:72 - Objective met. Exiting program.\n```\n\n\n## Installation\n\n1. Clone the repository.\n    ```bash\n    git clone https://github.com/jroakes/GeneticML.git\n    ```\n\n2. Navigate into the project directory.\n    ```bash\n    cd GeneticML\n    ```\n\n3. Install the required packages.\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Directory Structure\n\n```\nGeneticML\\\n|-- config.json\n|-- requirements.txt\n|-- src\\\n|   |-- main.py\n|   |-- code_manager.py\n|   |-- dependency_manager.py\n|   |-- interaction_manager.py\n|   |-- session_manager.py\n|   |-- taxonomyml_interface.py\n|   |-- utils\\\n|       |-- constants.py\n|       |-- file_operations.py\n|       |-- prompts.py\n|       |-- string_operations.py\n|-- dynamic_main\\\n```\n\n## Main Components\n\n### `main.py`\n\nThis is the entry point for the application. It orchestrates the entire program logic including session management, user interaction, and code improvement cycles.\n\n- `initialize_dynamic(objective: str)`: Initializes the dynamic environment.\n- `maybe_restart_config()`: Checks if the user wants to restart the configuration.\n- `main_loop()`: Main processing loop.\n\nFor more details, [see `main.py`](./src/main.py).\n\n### `code_manager.py`\n\nManages the code generation, evaluation, and improvements.\n\n### `interaction_manager.py`\n\nManages all user interactions, including collecting the objective and any necessary permissions.\n\n### `session_manager.py`\n\nManages session data and config.\n\n### `taxonomyml_interface.py`\n\nInterface to the large language model for code improvements.\n\n### `utils`\n\nUtility functions and constants.\n\n## How to Run\n\n1. Set your OpenAI key.\n    ```bash\n    export OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n    ```\n    or windows\n    ```bash\n    set OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n    ```\n\n2. Run `main.py`.\n    ```bash\n    python geneticML/main.py\n    ```\n\n## Contributing\n\nIf you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjroakes%2Fgeneticml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjroakes%2Fgeneticml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjroakes%2Fgeneticml/lists"}