I want GPT4 to analyze text and to give me an answer in a predetermined format, without preceding texts like “Certainly! blah blah blah…” or commentary, notes, or anything like that.
I just want the straight answer.
The predetermined format is a numbered list.
I tried this text:
"…without any preceding text or commentary. "
“Only give the answer in the following format:…”
I even provided examples.
Yet I still got commentary.
Any further suggestions?
Give the model an example to use (called a shot) show it how it should respond and then under that say “given then above as an example please now do this…”
In your example you should use generic terms for things that help the model to understand what should go there. You can also wrap your example in ### example ### markers so the model understands this is where the examples are.
In my experience asking for a specific format in the system message often works well, but I mostly tried it with common structured formats such as json which possibly work better.
In your case you can probably ask in the system message to return an ordered array and later parse it to a numbered list.
If that works for you, you’re welcome to try out Promptotype which is a tool I created to develop and test prompts in this specific use case.
You may need to be careful and double check the results. For example, I told GTP 3 and 4 to give me just results when I ask for unit conversions and it worked - except that the results were incorrect! It only gave me correct results when I let it do and explain the calculations step by step…