> You give them a prompt and they complete based on that. If the prompt contains an indication that the counterparty should take on a certain role, the follow-up text will probably contain replies in that role.
Or, more succinctly, you give them a role.
If I tell you to roleplay as a wizard then it doesn't matter that you don't have a "role" API does it? We would speak also of asking them questions or giving them instructions even though there's no explicit training or API for that, no?
Yes, if the role goes out of the context window then it will no longer apply to that context, just like anything else that goes out of the context window. I'm not sure how that affects my point. If you want them to behave a certain way then telling them to behave that way is going to help you...