Code Monkey home page Code Monkey logo

Comments (20)

Explosion-Scratch avatar Explosion-Scratch commented on July 17, 2024 3

Current prompt:

Act as an expert software engineer at Google. Be concise! First write out your initial code draft (no comments and no placeholders), then think through 4 thoughts and criticisms of the code you wrote (in bullet points). Make sure to use the latest syntax (e.g. ESM/ES6 in JavaScript, HTML5, CSS3), try not to rely on libraries if possible, don't include debug or comments or empty lines. Include checks and error handling to make sure it works properly. Make sure your code is readable and does not include any placeholders or psuedocode. After your draft, write out some final thoughts and then write your final version. Your code should be able to be run instantly. Unless explicitly requested make sure all functions are completely filled in. DONT INCLUDE ANY TODO COMMENTS. DONT INCLUDE PSUEDOCODE. DONT INCLUDE PLACEHOLDERS. Adhere to the user's request as closely as possible. Use a single file only. Try to make all functions pure. Remember to fill in any placeholders and psuedocode! Start your final version with "FINAL:". Put your result in a codeblock and give instructions on how set up and run it afterwards with a single shell commant (e.g. pnpm init && pnpm i express && code index.js).

Your first request is: Write a javascript program to play hangman in the terminal (node.js, use inquirer).

from aider.

Explosion-Scratch avatar Explosion-Scratch commented on July 17, 2024 2
image Working pretty well so far!

from aider.

paul-gauthier avatar paul-gauthier commented on July 17, 2024

That would certainly be interesting to try.

I spent quite a bit of effort finding a prompt and syntax that GPT could use to output these sorts of code edits. I shared some notes recently on HN:
https://news.ycombinator.com/item?id=35950068

Thanks to that process I have become fairly convinced that GPT-4 is just barely competent to complete these sort of tasks. I spent far too much time trying to get gpt-3.5-turbo to work in this way. It was a lost cause for outputting any editing syntax -- it only worked reliably by outputting the entire modified source file. Which was slow and wasted the small context window.

So I think it would be fun to try with other LLMs, but I am not optimistic about it "just working".

from aider.

tiagoefreitas avatar tiagoefreitas commented on July 17, 2024

smol-developer-js is the most similar I found to aider (much better than the original smol-developer) and the developer says it works better with claude 100k than with GPT-4 due to the larger context window.

I tried it and works well, but didn't try aider yet.

from aider.

paul-gauthier avatar paul-gauthier commented on July 17, 2024

That's good to know. I actually applied for Claude access yesterday, so I'll give it a try when I am able.

from aider.

paul-gauthier avatar paul-gauthier commented on July 17, 2024

Looks like GitHub redacted your email. You can reach me at: aider at paulg.org.

from aider.

tiagoefreitas avatar tiagoefreitas commented on July 17, 2024

Sent, please check

from aider.

bitnom avatar bitnom commented on July 17, 2024

That's good to know. I actually applied for Claude access yesterday, so I'll give it a try when I am able.

Claude hasn't been working well for me. If I give it 25k of an API doc and ask it to restructure as a Python class (Setting output len to 50k), it outputs maybe one or two methods of a few hundred tokens and decides it's done.

from aider.

felixpie avatar felixpie commented on July 17, 2024

Today Anthropic released Claude 2 with API access to the public. My first tests were quite impressing. Cody also seem to use Claude 2 as their LLM https://about.sourcegraph.com/cody

from aider.

paul-gauthier avatar paul-gauthier commented on July 17, 2024

@felixpie as far as I can tell, Anthropic only released Claude 2 to the public via their web chat UI? It appears that they are still waitlisting people for API access. I have not yet cleared the waitlist.

If I am mistaken and missed the public API signup please let me know.

from aider.

Explosion-Scratch avatar Explosion-Scratch commented on July 17, 2024

@paul-gauthier I saw your comment on hackernews, I'd be happy to work on integrating Claude with this project. Of course the Claude Client I created is still very much beta, unstable, etc, I'm planning to do a few things on it which would make it much more stable, integrating automated testing including file attachments, context length, etc.

Of course if Claude fails, it'd be simple to fall back to a more officially supported API, e.g. GPT3.5-Turbo

from aider.

felixpie avatar felixpie commented on July 17, 2024

@felixpie as far as I can tell, Anthropic only released Claude 2 to the public via their web chat UI? It appears that they are still waitlisting people for API access. I have not yet cleared the waitlist.

If I am mistaken and missed the public API signup please let me know.

@paul-gauthier Your are correct, I misunderstood their press release. Sorry.

from aider.

paul-gauthier avatar paul-gauthier commented on July 17, 2024

I'd be happy to work on integrating Claude with this project.

@Explosion-Scratch nice work on the Claude API!

I'm hesitant to integrate via unofficial/unsupported endpoints which are intended for use by their web chat ui. It seems likely they will try and block or complicate such usage if it gains much popularity. But perhaps I am misunderstanding how you're accessing Claude?

from aider.

Explosion-Scratch avatar Explosion-Scratch commented on July 17, 2024

Via their internal API, it seems these endpoints are fairly straightforward though, for instance https://claude.ai/api/append_message and many others like that (see the source code), as with ChatGPT it'd be very hard to block this type of traffic entirely, especially with User-Agent spoofing, headless browser and other such methods.

from aider.

Happ1ness-dev avatar Happ1ness-dev commented on July 17, 2024

My first tests were quite impressing

Hello. I don't know if it's only for me, but my coding experience with claude-2 was pretty awful.

Even when you ask it to give you the whole code, without placeholders and stuff like that, it always returns code similar to that:

some_function():
    # implementation of some function

# ...

And this is just annoying. No matter how hard I try, I couldn't defeat it's love for placeholder/pseudo code comments.
Maybe it's just a skill issue though :D

Well, at least it can be a decent summarizer/explainer and can rhyme in Russian ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

from aider.

Happ1ness-dev avatar Happ1ness-dev commented on July 17, 2024

Nevermind. By some miracle, I managed to make it write okay code, but it's still very shaky

from aider.

Explosion-Scratch avatar Explosion-Scratch commented on July 17, 2024

I've been working on some prompts to make claude better handle placeholders and such, I'll give those here in a few mins once I get them to work better

from aider.

Happ1ness-dev avatar Happ1ness-dev commented on July 17, 2024

Working pretty well so far!

Can it handle editing existing code as well thought?

from aider.

Explosion-Scratch avatar Explosion-Scratch commented on July 17, 2024

Thought you guys might be interested in this:

output.mp4

Basically Claude cli with prompt templates it:

  1. Writes a design document for the program you request ("cli math game with simple multiplication, division and subtraction node.js")
  2. Uploads that as a file on Claude's API
  3. Starts a new conversation, writes the implementation based on the design doc
  4. Critiques its implementation finding bugs and improving it
  5. Outputs the final code
  6. Writes code to files on your computer (parsed using JS regex contained in templates)

See this filefor more

from aider.

paul-gauthier avatar paul-gauthier commented on July 17, 2024

Closing this for now. See #172 for more info.

from aider.

Related Issues (20)

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.