Git Product home page Git Product logo

gpt-engineer-parse's Introduction

gpteng-engineer-parse

Separate the files from this prompt's https://github.com/AntonOsika/gpt-engineer output

usage

Invoke main.py and it will parse what is on standard in

python main.py < gpt-fizzbuzz-overkill-output.md

It produces files in ./output/

Note: do your best in your prompt to encourage the filenames to be on lines by themselves. Adding more parsing options but for now the multiline regex is simple

Note:Get clean filenames your prompt with this help: (it's not perfect)

List filename for each block by themselves on a line before the block.
Do not describe anything after the last code block.
Do not label the file name of each file in the project.

output

$ tree output
output
├── App.js
├── Auth0Login.js
├── Button.js
├── fizzbuzz_lambda.py
├── Highlight.js
├── README.md
└── server.js

1 directory, 7 files

explanation

a prompt for an overkill version of fizzbuzz:

write a version of fizz buzz with a react front end, using auth0 for a login.

The react application is created by create-react-app

The main view of the application contacts a lambda function to get the full fizzbuzz output string and display it in a Highlight component.

Write a lambda funtion in Python that counts Fizzbuzz from 1 to n where n is passed to the lamda function

write an ExpressJS server that offers a REST endpoint that when contacted starts the fizzbuzz lambda

The React application includes a button that contacts the rest API on Click.

List filename for each block by themselves on a line before the block.
Do not describe anything after the last code block.
Do not label the file name of each file in the project.

It creates the following structure in the markdown, with a preamble w clarifications that gpt-engineer asks, this parses through all of that, generates a README.md


Core classes, functions, and methods:
- Lambda function: `fizzbuzz_lambda` - counts Fizzbuzz from 1 to n where n is passed to the lambda function
- ExpressJS server: `server` - offers a REST endpoint that when contacted starts the fizzbuzz lambda
- React application: `App` - main view of the application that contacts the lambda function to get the full fizzbuzz output string and display it in a Highlight component
- Highlight component: `Highlight` - displays the full fizzbuzz output string
- Button component: `Button` - contacts the REST API on click
- Auth0 login component: `Auth0Login` - handles user authentication using Auth0

fizzbuzz_lambda.py
[backticks here Due to Markdown limitations the full output of gpt-engineer we have to omit. Three backticks begin and the file contents proceed]

server.js
[backticksgohere]javascript
const express = require('express');
const app = express();
const aws = require('aws-sdk');

So now you have code in files:

$ tree output
output
├── App.js
├── Auth0Login.js
├── Button.js
├── fizzbuzz_lambda.py
├── Highlight.js
├── README.md
└── server.js

caveats - other formats

Anything but labeling the filename on its own line right now breaks it. I prefer to suppress the descriptions with prompt shaping, we don't need them on those lines we are the ones that supplied the descriptions in the first place.

Lambda function in Python (fizzbuzz.py):
[block would be here, but this has extra stuff sometimes, sometimes quoted, sometimes not
[sometimes they make mistakes, you need to shape the prompt so that the filename is by itself]
Some file names come with extra decoration: "some desciprtio: : `markdown_splitter.py`"

gpt-engineer-parse's People

Contributors

jhare avatar

Watchers

 avatar

gpt-engineer-parse's Issues

Longer filename regex

Support file lines where the file is prefaced with explanation

entrypoint file: `app.js`
[backticksgohere]

I want to parse that in the multiline also, but it makes it really ugly

Post-process filenames

We might be able to elim the sentences after they've been pulled out. Can regex just a subsection then.

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.