How can i add breaklines to the output?

i would like the ai to generate output with break lines in it. is there a way to add something to the prompt that the system will listen to. right now simply adding
doesnt work. it will work sometimes and others it will return the break line as code in the output. thanks for any help guys!

id also like to add that sometimes it will even make some break lines in the text but than part way down it will start mashing everything back together,

Hi Campnorth9,

If you want to avoid it generating code, you may want to avoid using the phrasing “break line” as this is commonly associated with a <br> HTML element. What I would suggest is asking it to insert some kind of “tag” to represent a line break which you can then process later. You could prompt engineer it to output something like:

Hello there[NEW_LINE]My name is Xeen and I like chocolate.[NEW_LINE]Thanks for reading!

Then you process the output in your code to replace [NEW_LINE] with the appropriate line breaks.

Alternatively, you can just try asking it to not include any code and to write it as a string as part of the text.

Hope this helps

Hello, thanks for the response. I was using a
in the promt and it would add some occasionally. i will try the new line thing to see if that works. i might also try to ask it to add break in between also and see if that works

thanks for the help

asking the system to add [NEW_LINE] doesnt work. the ai is returning it only part of the time than on other ocasions returning it with { } or only half of it comes back or even none. also other times it is returning the sentence that i used - “write [NEW_LINE] as a string as part of the text”. do you have any other suggestions for how to do this to add html break lines in between things?

Hi Campnorth9,

Show us your prompt and your expected output so people can advise on how to improve on it. On that note, you can always provide chat GPT an input/output example as well so it gives more accurate outputs :slight_smile:

i got it to work by using \n\n this causes the api to produce the proper output! thank you again for the help

2 Likes

@Xeen Is it possible to force it to wrap every line that is longer than say 100 chars?