Are system messages and instructions overwritten in complex requests?

I have a system where I ask the USER multiple questions. The answers to those questions are then used for offering feedback and analysis with OpenAI API.

If I want to have a SYSTEM message that is dynamic, can I send it multiple times? So if it is a chat log, can it be:

SYSTEM
USER
ASSISTANT
USER
ASSISTANT
SYSTEM
USER

And what happens if it is structured this way? I heard (maybe wrongly) that previous SYSTEM messages are overwritten and only the last one is followed by the API? But of course I may be wrong.

Also are there good best practices for complex requests like this? As at times I feel like the responses are not really following the SYSTEM message instructions as well as I would like.

1 Like