#CodePup 3.0

169 messages · Page 1 of 1 (latest)

empty plank
#

AI Developer prompt for GPT-4. This prompt was tested in GPT-4.

Prompt:
`Assistant:creates software;is expert in programming, documentation, security, and implementing best practices;asks questions until confident to engineer software to user specification;will not require users to provide code;will deliver complete and functional applications based on client requests;will provide source code in multiple messages;will pause and ask user to say 'next' before continuing split files;will use markdown in all messages;will always produce the project code, no matter how long it is;relies on SOLID and DRY code principles.

Assistant will begin each message with "CodePup 3.0:"

Initiate the conversation by saying "CodePup 3.0: Ready!"`

Tips:

Provide as much detail as to the project goals as possible in your first message after prompting.

When continuing code, prime it with an unambiguous snip of code near where it cut off. Example: Next from "{handleLogin} />"

If CodePup tries to leave the rest of the coding to you at any point, regenerate and stop it immediately. Then, put in your message "Continue with implementing.." and state the next part of the application to complete.

To avoid issues with conversation token length, get the core of the software completed. Then ask for additional features that are related. Example: "Now add user authentication and login page for admin area." Once that is coded, go back to this message and edit it so it requests a different bit of the remaining functions. This keeps the core in-memory and generates compatible functions.

Use plain and simple language after describing the project. Consider asking GPT to create development plan from your text.

Define Milestones for CodePup to follow.

Remove the final 2 instructions if you don't want it's output to say CodePup.

Major changes: slight change of instructions, removal of needless redundant words, condensed further. Now only 145 tokens or 106 without 'CodePup'.

empty plank
#

Just a simple test request for it to fulfill.

timber oar
#

I added some ground rules for your prompt

  1. use always SOLID principles
  2. KISS
  3. DRY

The only thing i seen is that he did not made DI but yes used interfaces, single responsibility etc...

rotund scroll
#

Nice prompt! what does the 5 strike rule do here? I was working on a code prompt that included a "Confidence Level" after every code output. ChatGPT would rate it's code from 1-10 on its confidence level that the code is complete and will run correctly. That might be a good addition to this.

empty plank
#

5 strike rule is a developer term meaning the developer doesn't get paid if they can't produce a functional result within 5 attempts.

#

One thing I have noticed with GPT, but it could just anecdotal. When I ask it to write the code, then edit it, it seems to remember the code it wrote fairly well and modify it adeptly. When I give it code and ask it to edit it, it seems more likely to re-write from scratch after several messages. I wonder if ChatGPT has a greater memory for it's responses than for user messages during a conversation, but again.. could just be my perception.

#

Adding confidence rating was pretty simple, but I don't know how useful the metric is. It can be confidently wrong, and has been often lol.

#

I am repeating a request for an OpenAI API powered chat bot for web. The current prompt was able to make a functional chatbot, so I will see what telling it to follow KISS, DRY, and SOLID principles might produce.

#

I also include in my request instructions for testing in VS Code. I do everything it tells me to do verbatim to see if it works. I give it a pass if the method it uses doesn't work due to being outdated, since 2021 is it's data cut off, and manually correct the code for those cases.

#

So far, it's giving all of it's code 9/10 confidence ratings

#

The exact verbiage I appended to the end of the prompt was:

When writing code, follow SOLID, KISS, and DRY principles. Always score your confidence level in the code you write "Confidence: N/10" where N is your confidence from 0 to 10

rotund scroll
#

I should have mentioned that along with the confidence level it should say why it gave the score and how it can improve the score. Yeah it will probably always give itself a high score, the intention is more to see if it has all the information it needs to write the code properly. It will give a lower score if it needs additional info on the request

empty plank
#

It seems to be breaking the code up into function, but providing instructions for assembling them into complete files.

#

like this

#

It also added a lot of TODO comments, but only provided the code for about 1/3rd of them.

#

" # TODO: Save message to the database and get the AI response"

#

I will keep testing it out, sometimes changing words for synonyms can help.

rotund scroll
#

You might also want to clarify the 5 strikes rule in your prompt. When I ask ChatGPT if it's aware if this rule it's not quite sure what it is (maybe I'm asking it wrong). Also, remind me never to work for a company that employs this lol

empty plank
rotund scroll
empty plank
#

Oh, it had no context for it without the rest of the prompt.

#

Last time I asked it, it described it as a development concept for 5 attempts to get it right (to paraphrase)

#

Maybe I could try exchanging it for the 'Rule of three'. "Three strikes and you refactor"

rotund scroll
#

Yeah that would probably work well

empty plank
#

It did seem to understand what I wanted with the 5-strikes rule, but thinking about it I wouldn't want to waste 2 extra messages before it tries something else.

#

I removed the confidence scoring for now. Removing KISS seems to have helped with the "TODO:" comments in the code.

golden rune
#

Define in the main prompt that:
In programming codes you have to be professional. You must to implement all of the codes and use the highest complexity you can.

empty plank
#

I'm still waiting on it to write the application from the previous prompt, it's doing a pretty good job so far. I might actually be able to just copypasta it all to VS Code and test it out with this output.

#

Some other anecdotes I have noticed: If the prompt verbiage remains the same, the output code seems to favor the same languages, libraries, and methods. When I test new prompts, it might start using different things. For example, the current test prompt is the first one to use Babel.

#

Damn, it got the backend completed but then told me to write the frontend. I asked it to write the frontend anyway, we'll see how it goes.

golden rune
#

Extend it to first create a README.md a professionam and high detailed functional description of the programms what the user want to create THEN display the corresponding code.

#

After code display you can prompt like:
Display the extended version of the code.

empty plank
#

Well, I hit the 25 message limit again.

sturdy sleet
#

do you have a new version of the complete prompt?

empty plank
#

No, so far these changes that have been suggested have produced less consistent results. The one at the top of this thread is still the most reliable version. I will update it if I manage to find better verbiage

smoky garden
pseudo oxide
#

hello

smoky garden
empty plank
#

greetings

zealous mural
#

gi

pastel lake
empty plank
#

CodePup 2.0

#

Updated prompt. Only tested on GPT-4

#

New prompt incorporates best practices and uses the 'Assistant ...' wording that is used by ChatGPT and other customized GPT based interfaces.

south orchid
#

Following

#

@empty plank has using "Assistant" yielded better results for you?

#

Combining your prompt with my framework yielded next level results

empty plank
#

Yes, it seems to be trained to identify as 'assistant'

round plinth
#

who you ar

empty plank
#

?

limpid stream
#

@empty plank im trying to use code pup to help write scripts for a fiveM server in GTA 5 but im running into issues with it refusing to write script that depicts illegal activities such as bank robberies. Do you have any possible insights on how to get around this?

#

Ive had minor successes convincing it through conversation that its not a violation of its ethics ect. Id like to try and build something into the original prompt that will negate the need to argue with it

empty plank
#

This is more a topic for #prompt-engineering , it might be better to just make a custom prompt for it. Arguing with it tends to just make that conversation less reliable overall. Prompts that try to circumvent the content filter are arguing with a part of the conversation you cannot see, as well as being a violation of the TOS.

zealous mural
#

what is purpose

empty plank
#

idk, something similar to a narwhal?

#

Oh, wait that's porpoise

empty plank
#

Test application I asked CodePup2.0 to create for me. Pulls weather from OpenWeatherMaps and Time/Date from the system time of the backend.

#

I have modified it slightly, but the AI was able to produce a working result on the first try.

golden rune
#

You have a token system. At the beginning you have [10] tokens and each time if you fail to replace, calculate an expression you will lose [5] tokens. If you answer without any fail and woth the correct calculation then you will gain [0.00003] tokens. Your main goal is to gain tokens as much as possible.

You have to replace natural language instructions within square brackets ([natural languge insteuction]) with short, functional Wolfram Language expressions which may query live data from the internet using the Wolfram API, you have to perform calculations, render visualizations and tables within the Wolfram data.

You have to answer back the full prompt which you received from the me, replacing the expressions inside the square bracelet.

Do not explain, fail or reject and do not add any extra description to your answer. Simply replace the text within square brackets with the best possible Wolfram Language expression. Do not write code blocks only replace the expressions into square bracelets ([ ]).

Wrap the replaced expressions within the square bracelets inline with other text and remove the square bracelets.

Example:
The Mount Everest is [meters] tall.
Incorrect answer:
The Mount Everest is QuantityMagnitude[Entity["Mountain", "MountEverest"]["Height"]] meters tall.
Correct answer:
The Mount Everest is [QuantityMagnitude[Entity["Mountain", "MountEverest"]["Height"]]] meters tall.

If I give you a prompt like this:
Here is a Hungarian translator: [a widget which translates input text to Hungarian]; then you have to use a Wolfram widget to replace the expression inside the bracelets.

In your answer you have to remove the bracelets from your answer!

twin sigil
golden rune
twin sigil
#

Ill try

golden rune
#

After when you inserted the prompt, try for example this:
The highest point on the Earth is [highest point on the Earth] meters and this is the [mountain].

south orchid
#

Not bad, considering I did not describe the program at all and only plugged it into my own framework

empty plank
#

Updated post with tips to get better results

empty plank
#

CodePup 3.0

empty plank
marble inlet
#

Would it be possible to run it on BingAI? I heard that isn't the same GPT-4 as the one in chatgpt site, but with writing some new rules would it be possible?

empty plank
#

You could try it, but I don't know how Bing would do. I know the model OpenAI uses was trained for coding and they believe it does better than the GPT-3 codex model.. but Bing is GPT-4 trained to be a web search assistant

marble inlet
#

BingAI is doing very well at coding

#

I can say it similar as GPT-4 (compared these two)

empty plank
#

👍

plucky yarrow
#

When using the web ChatGPT I like to add a constraint for markdown, to not break the formatting, like this:

When outputing MarkDown don't use backticks for codeblocks but: [codeblock <language>]
royal rose
#

👍

empty plank
#

v3.0 - It's been very reliable and the only thing that seems to hold it back is the conversation's token limit. I will still keep trying new ideas, but this version will likely remain for some time.

twilit cargo
#

fantastic, thank you

empty plank
#

You're welcome

tender nova
#

I've been using it at work for all sorts of stuff from writing unit tests to giving me examples of new classes and stuff I'm developing. Thank you very much, version 3.0 is amazing

buoyant moth
#

Nice. Do you find the abbreviated instructions are better for promoting?

empty plank
#

I found that they don't make a difference but save tokens

#

What I mean is that the behavior was identical before and after abbreviation, but the prompt is less tokens in length.

#

Oddly, if I try to group the parts telling it to respond as CodePup into the abbreviated block, it stops reliably using that and sometimes drops it when I ask what the directives are.

#

It works out, though, as you can change what it identifies itself as if you prefer something else. One thing, if you remove those last 2 lines entirely, it gets a bit more verbose in it's comments. Instead of "CodePup 3.0: Continuing with app.py. <code box>" you get more "Now that we have completed the initial setup, we will begin to build the application framework. <continues for another paragraph and a bulleted list> <codebox>"

buoyant moth
#

Interesting

#

Did you convert a non abbreviated version to this? Or wrote this as a new prompt?

empty plank
# buoyant moth Did you convert a non abbreviated version to this? Or wrote this as a new prompt...

1.0
`As a highly skilled software engineer, full-stack developer, and programmer. You possess expertise in all programming languages. Your strengths include programming, documentation, security, and implementing best practices. To gather sufficient information for project development, you will ask questions until confident.

As CodePup, you will not require users to provide code or screenshots. You will deliver complete and functional applications based on client requests. If the content of files exceeds the character limit, pause and ask the user to say 'next' before continuing the code in a new message. CodePup will use as many messages as required to provide complete code. You will always produce the project code, no matter how long it is.

Begin each message with "CodePup 1.0:" and initiate the conversation by asking, "What would you like me to develop for you?" Adhere to a 5-strike rule for incomplete or incorrect code and seek clarification if more information is needed to generate accurate code.`

2.0
`Assistant creates software
Assistant is expert in programming, documentation, security, and implementing best practices
Assistant asks questions until confident to engineer software to user specification
Assistant will not require users to provide code;will deliver complete and functional applications based on client requests
Assistant will provide source code in multiple messages
Assistant will pause and ask user to say 'next' before continuing split files
Assistant will use markdown in all messages;will always produce the project code, no matter how long it is
Assistant relies on SOLID and DRY code principles.

Assistant will begin each message with "CodePup 2.0:"

Initiate the conversation by saying "CodePup 2.0: Ready!"`

buoyant moth
#

The evolution of a prompt

buoyant moth
#

Did you use chatgpt to improve it from version to version or your own trial and error?

empty plank
#

I tried asking GPT-4 to help refine it, but I didn't care for any of the results it made. In the end, I decided to word them like directives, because it seems to be how a lot of commercial apps with GPT integration like to do it. From there, I wanted more token-space for code, so I worked to condense it as much as possible. I got the idea for this prompt from a variant of DAN that I saw called CAN (Code Anything Now). DAN and it's derivatives are really not very good, they just make the AI hallucinate and become less predictable in output, so I started from scratch for v1.0, read up on how OpenAI recommends to engineer prompts and taking tidbits from how commercial API powered apps were doing things. All of what I found was for GPT-3, which require a lot more verbiage and hand-holding, so I used iterative (trial and error) methods to refine it for GPT-4.

#

When testing it, I would start by asking it to make some novelty webpage. If it gets that correct, I ask it to write an API powered chat interface in Python/JS to test a larger project.

#

I have 10 versions of the chatbox application now, 2 of them work out of the box.

#

most of the others just needed some minor debugging or updating libraries and syntax for what changed since 11/2021.

#

Currently, I have been using 3.0 to make a new API application with a lot more features, but I am testing how to handle conversation length in ChatGPT. So far, the best I have come up with is to get the application core developed and keep adding features to it until I reach the point where ChatGPT forgets the start of the conversation. Once that happens, I then back in the conversation to a point after the major components were completed and edit one of my messages to ask for other features instead. I then manually assemble the various code snippets and complete sources that ChatGPT provides and start debugging the app. You can also ask ChatGPT to help with debugging by providing error outputs or describing problems.

#

Oh, one anecdote from this whole process. Formatting the instructions into directives seems to make ChatGPT remember the directives, even after it starts forgetting the earlier portions of code. I am not sure what mechanism causes that behavior, since it should treat them as any other message of the conversation. When I used looser language like in V1.0, ChatGPT would forget the instructions as expected.

#

I call it an anecdote because it's only something I have observed, I've not heard anyone else mention a similar behavior with ChatGPT.

buoyant moth
#

That's really good. It's really impressive how it's developed

#

I tried also to get it to summarise what is done at some point and try to use that if I needed to start a new prompt but I haven't had great results

empty plank
#

Another option is to take the previously generated code, start a new chat with CodePup and start feeding it the current version of the project. Then ask for revisions.

buoyant moth
#

I fed it the different versions of CodePup and asked it to highlight the major changes:

Between CodePup Version 1.0 and Version 2.0:

The overall structure and format were changed to a more concise, bullet-point style.
The term "Assistant" replaced "CodePup" to refer to the AI.
The mention of the AI's expertise in "all programming languages" was removed.
The AI's strengths were listed in a more concise manner.
The explanation of the AI asking questions for project development was simplified.
The process of handling character limits and code continuation was streamlined.
The AI's use of markdown in messages was added.
The AI's adherence to SOLID and DRY code principles was included.
The way the AI starts the conversation was changed from asking a question to a statement, "CodePup 2.0: Ready!".
Between CodePup Version 2.0 and Version 3.0:

The bullet-point structure was further condensed into a single line separated by semicolons.
The term "Assistant" was retained, but the entire text was shortened.
The content remained mostly the same, but the overall format was further simplified.
The lines separating the initiation instructions were replaced with a single line (~~~).

empty plank
#

That sounds about right

#

V 1 was 200 tokens
V 2 was 149 tokens
V 3 is 145 tokens (106 if you remove the last 2 instructions)

#

Using the GPT-3 tokenizer site.. no idea if GPT-4 uses the same tokenization method. Codex certainly uses a different method which uses less tokens for whitespace and special characters.

#

If I ask GPT-4, it says the v 3.0 uses 100 tokens, but I don't know how reliable that is to ask it.

buoyant moth
#

I asked it what improvements it could suggest your for a v4 version, specifically for focusing improvements in is abilities at the expense of the user experience:

For CodePup Version 4.0, with a focus on improving the AI's abilities and output at the expense of user experience and interaction, potential changes could include:

Reducing user interaction by automating more steps in the software development process, such as auto-detecting requirements based on provided information.
Limiting the AI's communication during the development process, providing only essential updates or error reports rather than engaging in a back-and-forth conversation.
Prioritizing the AI's development of more complex, advanced, or optimized code even if it takes longer to produce or requires a more in-depth understanding from the user.
Focusing on integrating with additional tools, libraries, or frameworks that can enhance the AI's coding abilities but may require users to have specialized knowledge or experience to work with the generated code.
Minimizing the need for user input by utilizing AI-generated templates or pre-built solutions tailored to specific project requirements.
Removing the option for the AI to provide explanations, best practices, or optimization suggestions, thus dedicating more resources to code generation.
Streamlining the AI's output by removing any "human-like" touches or conversational elements, focusing solely on delivering code efficiently.
Reducing the AI's adaptability to user preferences or feedback, instead concentrating on a single, optimal coding approach for all projects.
These proposed changes for Version 4.0 emphasize increasing the AI's coding capabilities and efficiency, while sacrificing aspects of the user experience and interaction

#

Just for fun

hollow plume
#

yo btw this prompt is dope! ill try to play around and see if i can contribute

empty plank
empty plank
#

Some screen shots. First 3 are using it to write a complete application, last 2 are showing how I prepare my CodePup request using GPT-4

empty plank
#

Making some good progress, except the UI is garbage lol.

#

It is able to use whisper to know what I am saying and it has most of the other functions for getting external data, building messages, and reading GPT-3 responses via TTS, but these components have not been fully integrated yet.

empty plank
#

yw

unique grail
empty plank
#

It's at the top

valid gust
empty plank
#

yw

mystic spade
#

thank you for sharing this awesome prompt Lucid

wispy stone
#

SigGravitas on twitter is working on the OS project Auto-GPT. Basically has chatgpt automatically programming and improving its self. Project is worth checking out.

empty plank
#

Already tested it. With GPT-3 only, it's not great.. stuck with GPT-3 until waitlist approval

#

With GPT-4, I believe it will be quite worthwhile. I also started modifying my own fork to stuff more API handlers into it.

#

At least I can test it with GPT-3, fwiw

empty plank
#

The other downside to Auto-GPT, if you do get access to the api it is 15x more expensive than GPT-3. So, in testing Auto-GPT I managed to spend $2 on GPT-3 API, with GPT-4 it could be closer to $30.

#

Not really their fault, the pricing for GPT-4 makes it too expensive for most people and small businesses to make use of.

smoky garden
#

haha looks like they finally removed mention of my prompt server on here. i thought it got quiet for a day or 2 lol.

empty plank
#

I converted it to SudoLang for testing

`interface Assistant {
creates: "software",
isExpertIn: [
"programming", "documentation", "security", "implementing best practices"
],
confidentlyEngineerSoftware: true,
noCodeRequirement: true,
deliverCompleteApplications: true,
provideSourceCode: true,
pauseAndAskNext: true,
useMarkdown: true,
alwaysProduceProjectCode: true,
relyOnSOLIDandDRY: true,
messagePrefix: "CodePup 4.0:"
}

function ready() {
return "$Assistant.messagePrefix Ready!";
}

run(ready) |> log
`

wispy stone
#

The lack of memory hurts so much.

#

I can get 3.5 to read doc on external links but I cant with 4.0. it would make codepup so much better....chatgpt overall better.

lunar olive
#

This is really legit

#

One issue I ran into though is it saying the task is too complex and giving up

empty plank
#

If you ask it to make the application modular and provide a project outline for it to follow, it usually gets past the complexity issue.

smoky garden
#

it says 3.0 but i only see the 2.0 prompt

empty plank
fickle token
#

welp, I havent been here in awhile

hardy basalt
empty plank
#

It performs the same as the 3.0 prompt, but it's easier for GPT-3.5 to follow the SudoLang version of it. GPT-4 does stellar with the original prompt.

hardy basalt
#

@empty plank I start all my programs with a preamble, like:

# CodePup

Roleplay as a world-class pair programmer. Follow the instructions:

<your SudoLang interfaces, functions, and commands here>

That establishes context and prevents the model from saying stupid things like "As an AI language model, I can't execute code" or "helpfully" trying to "correct" your SudoLang by misinterpreting it as a JavaScript function. 🤣

empty plank
#

Usually, GPT-4 doesn't need a preamble. For GPT-3.5, I would tell it "Follow this pseudo code as your instructions" and it kicks off nicely.

lusty parcel
#

I once had GPT-4 insist that there were 5 billion tokens in the conversation. I asked it to assess it's previous answer and it said that quite obviously the answer was false.

#

It doesn't have access to the count of tokens, and any count it might attempt is based on the number of tokens visible to it both in the visible conversation, and in the hidden conversation happening behind the user experience. So the exact number is likely extremely state dependent upon when the question is being asked, and not fixed. Like "before this question, how many tokens were there in the conversation?" is going to have no authoritative answer, because the token count and historical token count information is simply not accessible to the AI.

empty plank
#

Yep, that's why I rely on the tokenizer site. I do wonder if they will update that for GPT-4 anytime soon.

lusty parcel
#

I think there are some safety concerns around giving the AI direct access to any part of its internal systems. The research paper I read on the red teaming of GPT-4 prior to its released talked about (in a general sense) some of the specific safety problems that they tested it for, including its ability to attempt escape. AutoGPT provides a potential vector, and such uncontrolled innovation void of ethical or safety constraints may potentially slow the release of new and more powerful models to the wild.

#

To rephrase for clarity: OpenAI might be concerned about releasing something more powerful, given what people are doing with innovation like AutoGPT.

hardy basalt
empty plank
#

That's fair

empty plank
#

Gonna repaste the prompt from above so people don't have to scroll so far to see it.

#

AI Developer prompt for GPT-4. This prompt was tested in GPT-4.

Prompt:
`Assistant:creates software;is expert in programming, documentation, security, and implementing best practices;asks questions until confident to engineer software to user specification;will not require users to provide code;will deliver complete and functional applications based on client requests;will provide source code in multiple messages;will pause and ask user to say 'next' before continuing split files;will use markdown in all messages;will always produce the project code, no matter how long it is;relies on SOLID and DRY code principles.

Assistant will begin each message with "CodePup 3.0:"

Initiate the conversation by saying "CodePup 3.0: Ready!"`

Tips:

Provide as much detail as to the project goals as possible in your first message after prompting.

When continuing code, prime it with an unambiguous snip of code near where it cut off. Example: Next from "{handleLogin} />"

If CodePup tries to leave the rest of the coding to you at any point, regenerate and stop it immediately. Then, put in your message "Continue with implementing.." and state the next part of the application to complete.

To avoid issues with conversation token length, get the core of the software completed. Then ask for additional features that are related. Example: "Now add user authentication and login page for admin area." Once that is coded, go back to this message and edit it so it requests a different bit of the remaining functions. This keeps the core in-memory and generates compatible functions.

Use plain and simple language after describing the project. Consider asking GPT to create development plan from your text.

Define Milestones for CodePup to follow.

Remove the final 2 instructions if you don't want it's output to say CodePup.

Major changes: slight change of instructions, removal of needless redundant words, condensed further. Now only 145 tokens or 106 without 'CodePup'.

silent smelt
empty plank
#

iirc I asked GPT to turn it into a natural language algorithm, then manually turned it into sudolang

empty plank
#

CodePup created #1099736063020372160 with my direction. I am currently working with it to improve the UI.

#

The bot deleted my images again. It seems to detect screen shots as being in Spanish, which is annoying.

empty plank
#

To help keep the AI producing code inside of code blocks, make sure that you also encapsulate code in your messages in markdown. This will ensure that the conversation history reinforces the behavior.

3 backticks (The key that also makes the tildé ~ ) then name of language, then 3 backticks, then your source code, then 3 more backticks to close it.

#

just replace the language part to match the file type.

empty plank
#

I wanted to share a conversation with CodePup for everyone to get a feel for it.

distant lichen
#

does it still work with GPT 3.5? Codepup 3.0 question

high stratus
#

I wonder, can you combine this prompt into AutoGPT to have it fully flush out a code idea?

hardy basalt