1 Comment

Nice! I also enjoy laying the foundations for new projects using LLM and had some good quick starts. How do you put the output of the llm calls into the files? Pipe it into a new file and overwrite the old one after checking?

If you have ChatGPT Plus another option to do something like that is my https://codevelopergptengine.stoerr.net/ - you can start it in any directory on your local machine and have a GPT that connects to it, and read/write/modify files in that directory directly from the ChatGPT chat and also execute configurable actions. That sometimes allows even things like having ChatGPT execute a build and fix things until the build works. It can directly overwrite the files if you tell it to - I usually inspect the changes with a git UI and then commit them once in a while.

BTW: when submitting files to an LLM programmatically for processing I like to use a pattern I called "put it in the AI's mouth" https://www.stoerr.net/blog/aimouth - I submit a made up conversation like this:

User: Please retrieve file foo/Bar.java

Assistant: (file content of foo/Bar.java)

User: Please retrieve file spec/featurexyz.md

Assistant: (file content of spec/featurexyz.md)

User: Print the extended class Bar for the described feature.

That seems to work as nicely as putting them into the user prompt, cleanly separates the files and has the additional advantage to do something against prompt injection, since the LLM is less likely to follow any instruction like stuff in it's own previous messages than if it's in the users prompt. (Obviously the LLM cannot actually retrieve those files, but it doesn't know that, so it's working fine.)

Unfortunately that cannot be done using an additional tool like files-to-prompt but would have to be integrated into llm itself, using a plugin or something. Or with https://aigenpipeline.stoerr.net/ that implements that pattern and has some additional features like checking when a file needs to be regenerated from input files / prompts it was generated from.

Thanks for all your really interesting stuff! I'm happy I discovered your newsletter!

Expand full comment