The consensus on how to design few-shot prompts with the OpenAI API seems to lean towards including the examples in the system message. According to a forum post (https://community.openai.com/t/656727) on the OpenAI community, you can achieve few-shot prompting by providing examples directly in the system message. This is where you add the examples you want the model to refer to when answering the user message. You are still sending only one system message and one user message with the question, but the system message contains additional examples. There is no need to add additional system or user messages with replies.
Here's an example from the forum post:
System:
> "You answer questions about Ice cream. Answer with ‘Yes’ or ‘No’ only.
>
> When answering user questions follow these examples:
>
> Question: Is ice cream cold?
>
> Answer: Yes.
>
> Question: Does Ice cream make children happy?
>
> Answer: Yes
>
> Question: Can I fix my car’s overheating problem with ice cream?
>
> Answer: No.
And then you have the User message which will be answered according to your examples (few-shots).
> Can you write a 500 word paragraph about the advantages of eating ice cream?
However, it's also possible to include examples as user and assistant pairs, as shown in the OpenAI Cookbook (https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models#few-shot-prompting). This approach might be more suitable for certain use cases, especially when you want to demonstrate a specific interaction pattern between the user and the assistant.