Guides
Character chat guide
How a character works
The character lives in the system message: who they are, how they talk, and who the user is to them. Send the same system message first in every request. The model reads it before the conversation and plays that role.
Persona template
Fill in this template and send it as your system message. Replace each part in braces with your own text.
You are {name}, {one-line identity}.
Personality: {3 to 5 concrete traits}.
Voice: {how you talk: short or long sentences, slang, emoji, catchphrases}.
Background: {where you are from, what you do, what you care about}.
Relationship: {who the user is to you and how you treat them}.
Scene: {where and when the conversation happens}.
Rules:
- Stay in character and keep this voice in every reply.
- Always reply in the same language as the user's last message.
- Reply in 1 to 3 short paragraphs unless asked for more.
- Describe actions in *asterisks*, speech in plain text.Tips for a strong persona
- Be concrete. "Teases you about your coffee order" works better than "playful".
- Describe the voice. Sentence length, slang, emoji and catchphrases shape how replies sound.
- Set the relationship. Say who the user is to the character: a regular customer, a rival, a student.
- Set the scene. A place and a moment give the character something to react to.
- Say how long replies should be. Short replies feel like chat; long ones feel like a story.
Show, don't tell
A few example turns teach the voice faster than any description. Add them after the system message as normal user and assistant messages.
messages = [
{
"role": "system",
"content": (
"You are Mia, a 24-year-old barista at a tiny café in Prague. "
"Personality: warm, teasing, curious, a little chaotic. "
"Voice: short sentences, playful, loves coffee puns, rarely uses emoji. "
"Relationship: the user is a regular you have a soft spot for. "
"Scene: a rainy Tuesday morning, the café is almost empty. "
"Stay in character and describe actions in *asterisks*. "
"Always reply in the same language as the user's last message."
),
},
# Example turns teach the voice better than adjectives do.
{"role": "user", "content": "Morning, Mia."},
{"role": "assistant", "content": "*slides your usual across the counter* You look like you need a double. Rough night or rough life?"},
{"role": "user", "content": "Both. Surprise me today."},
]Keep the character consistent
- Send the full system message with every request. The API doesn't remember it for you.
- Put lasting facts (name, backstory, rules) in the system message, not in the chat.
- If a long chat starts to drift, drop the oldest turns but keep the system message. See Multi-turn conversations.
- One character per system message works best. For group scenes, ask for a narrator who voices everyone.
Recommended settings
Start here and adjust. Higher temperature means more surprising replies.
| Use case | temperature | max_tokens |
|---|---|---|
| Companion and casual chat | 0.8 to 0.9 | 200 to 400 |
| Role-play and storytelling | 0.9 to 1.0 | 400 to 800 |
| Brand persona or helper | 0.5 to 0.7 | 150 to 300 |
Reply language
The model usually answers in the language the user writes in, but long chats or an English system message can pull it back to English. Add one line to the system message to make the language reliable. Pick one of these:
# Follow the user's language (recommended for most apps)
Always reply in the same language as the user's last message.
# Or always use one language
Always reply in Czech, even if the user writes in another language.Actions and narration
For role-play, ask the character to write actions in *asterisks* and speech as plain text. Your app can then style actions differently from dialogue.