Giter Club home page Giter Club logo

tddgpt's Introduction

Autonomous Agent for Test-Driven Development (TDD)

"Programmers have programmed themselves out of jobs" - Unknown

tddGPT: ReactJS Counter App with GPT3.5

tddGPT is an autonomous coding agent that builds applications in ReactJS, Flask, Express, and more, all while adhering to the Test-Driven Development (TDD) methodology. It operates entirely without human intervention. Beginning with a project plan, tddGPT translates requirements into tests, develops code based on those tests, and debugs until all tests pass. Currently, it can build simple CRUD apps. The TDD framework keeps the agent focused and goal-oriented.

The core architecture is elegantly simple, utilizing just three tools: CLI, ReadFile, and WriteFile. It has been adpated from Langchain's AutoGPT example. Most enhancements were performed by GPT-4 itself over the course of a month-long chat interaction. I initially aimed to test the boundaries of GPT-4's capabilities in building ReactJS apps, and was successful in teaching it to construct applications step by step. In the process, it gained an understanding of temporal concepts like past, present, and future, as well as cause and effect.

The agent is not just a code generator; it’s also a learner. It evaluates its mistakes and areas for improvement as a final step, and some of these insights have already been incorporated into its operating prompts.

This project is in early alpha stage. GPT-4 API key is required.

Setup Instructions

  1. Setup a virtual environment:
python3 -m venv env
  1. Activate the virtual environment:
  • On macOS and Linux:
    source env/bin/activate
    
  • On Windows:
    .\env\Scripts\activate
    
  1. Clone the repository to your local machine:
git clone [email protected]:gimlet-ai/tdd-gpt-agent.git

  1. Navigate to the project directory:
cd tdd-gpt-agent
  1. Run the following command to install the package and its dependencies:
python setup.py install
  1. Set up your GPT-4 API keys as environment variables.
export OPENAI_API_KEY="sk-..."
  1. Run tdd-gpt-agent
tdd-gpt --prompt 'Build a minimal counter app in ReactJS with increment, decrement, and reset functions'

Check the counter-app directory for the generated app.

Example apps

The following are some apps have been built by this agent.

Similar Projects

Contributing

We welcome contributions to this project. Please feel free to submit issues and pull requests. For major changes, please open an issue first to discuss what you would like to change.

License

This project is open source, under the MIT license.

Contact

If you have any questions or comments, please feel free to reach out to us on GitHub.

tddgpt's People

Contributors

rajivpoddar avatar prthkms avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.