How to generate to separate lists from a single prompt

I’m building a software that needs to produce two lists from a prompt based on user input and certain criteria. However, I’m having trouble generating both lists from a single prompt. Is there a way to generate two lists from one prompt, or is there another method to generate two separate lists while preserving the context?

For example, imagine a scenario where a user provides a list of birthday gifts they’d like to receive, and the program needs to generate two lists: one that contains the gifts we have in stock, and another that lists the gifts we don’t have in stock.

Yes, see example I just tested for you @omer.harl

Here were the params used for the completion above:

So, the answer is yes, a prompt can be engineered to create two lists.

Hope this helps.


1 Like

To obtain the output in a specific format like a JSON or a list, the best approach I have found to be is giving it a sample when prompting it.

Hi, thank you for your answer.
However, when I try using this propmt the output I get is either one long string (yes it is numbered but it isn’t a list with elements) or sometimes I get just one list, with the headlines (such as “US list” and “Lake in the US list” in your example) being elements in that list.

Do you understand what I mean? If you’re still unsure about what I mean, could you please try generating the same two lists using the same prompt as before, store both lists, and then attempt to print out only one of the lists?

I hope this is a better explaintion of the problem?
Thanks in advance!

Hello, thank you for your response. I have attempted numerous variations, and while providing examples has been beneficial, I am still not consistently achieving the desired outcome.

What model and settings are using?

Can you share the prompt (using markdown)?

More info helps us help you… Thanks.

Not really, sorry @omer.harl

You are describing everything is causal conversational words and not providing your information to us in clear technical terms, as follows:

  1. The exact prompt you are using (in text)
  2. You exact completion settings, all of them.
  3. Your expected completion.
  4. Your “errors” completions.
  5. Your API code.

Software development is a profession which is quite simple because it’s based on facts, details and precision.

You are describing your problem in “casual conversational” terms and not providing the full technical details which are required if you wish to get professional help, and not a “stabs in the dark” and “guesses based on incomplete information”.

Hope this helps.