💬Message Roles
Also known as Chat Roles, Chat Message Roles, System, User and Assistant Roles
Tags on chat messages. They say who wrote each one: the app, the person or the model.
Think of it like
It is like a play script. Each line has a name on it, so you know who said it.
Example
A tutor app sends three messages. The system one says to be a kind maths tutor. The user one asks what 7 x 8 is. The assistant one holds the model's answer, 56.
Why it matters
Roles let the model tell your rules apart from the user's words. That is how it knows which to follow.
Definition
Example code
json
[
{ "role": "system", "content": "You are a kind maths tutor." },
{ "role": "user", "content": "What is 7 x 8?" },
{ "role": "assistant", "content": "7 x 8 is 56." }
]Common mistake
Key takeaways
- 1System. The app's standing rules.
- 2User. What the person typed.
- 3Assistant. What the model said back.