News for hackers. Stuff that matters.
Re:What Is the Most Minimal Agentic Coder You Can Write? by joshka on Tuesday March 25, 2025 @09:31PM (#43477927)
This was an experiment from a couple of years back with making the agent basically re-write itself based on the instructions you provide. You could probably code golf this shorter depending on the language. Arguably, this doesn't solve the problem directly, but it allows you to vibe your way there.

        import os
        import openai

        instruction = input("Enter an instruction: ")

        script_name = os.path.basename(__file__)
        script_code = open(script_name).read()
        response = openai.Edit.create(
                model="code-davinci-edit-001",
                input=script_code,
                instruction=instruction,
                temperature=0)

        new_script_code = response["choices"][0]["text"]
        with open(script_name, "w") as f:
            f.write(new_script_code)

There are no comments on this comment yet.