For example, if I asked GPT "How to make bibimbap?" with the prompt "skip prose", it will give concise list of ingredients and instructions in about ~250 tokens [1]. Without the prompt, it would first explain what bibimbap is and then give a slightly longer instructions, totaling around ~360 tokens.
[1] A token is like a building block of a sentence - it can be a word, a punctuation mark, a number, or even a combination of words. In case you didn't know, Chat API users are charged based on the number of tokens used. So we try to keep it to a minimum.
GPT: To sort a list of cities by population grouped by region, in JavaScript, would at a high level require 3 steps...."
Super frustrating when you just want the answer without the "polite professionalism"
Also, if you're using the playground, I'd recommend keeping the temperature low (I normally set it to 0 for this task). This will prevent any extra information such as test data, from being included. From my experience, setting the prompt I shared earlier as the system prompt produced more consistent results. However, whatever I shared is based on my own trial & error, so I'm not sure if this will work for you/in general.
GPT-4:
function sortCitiesByPopulation(cities) {
return cities.sort((a, b) => {
if (a.region === b.region) {
return b.population - a.population;
}
return a.region.localeCompare(b.region);
});
}
…