A character in your game can hold a conversation with the player in the language they are learning, pitched at their level. Each line the player says is one turn: the player kit sends it, and the character’s reply streams back in pieces.
What a turn carries
Every turn sends the whole of what the character needs, because Lingara keeps no conversation between turns:
npc: who is speaking. Its name is 1 to 32 characters, and its optional persona is one line of description, 1 to 120 characters, such as “a dumpling seller”.
scene: optional, where the conversation happens, 1 to 160 characters.
source_lang and target_lang: the player’s own language and the one they are learning. They must differ, and the character speaks only target_lang.
level: the player’s level, from 1 to 9. Lingara’s guide “What a level means” describes the scale.
line: what the player just said, 1 to 500 characters.
history: the conversation so far, oldest first, at most 12 lines. Each line has a speaker, either player or npc, and its text, 1 to 500 characters.
Each text is a single line. Your game keeps the conversation: the player kit holds the window for each dialogue you open, adds each finished turn to it, cuts each reply to its first 500 characters, and drops the oldest lines past 12.
Lingara treats the persona and the scene as untrusted text from your game. They shape how the character speaks, never what it is allowed to do.
How a reply arrives
The reply streams as pieces of text, which your game appends as they arrive. A notice may come between them, such as one saying the reply was cut short. The turn ends with done when the reply is complete, or with error when it failed. A turn is not resumable: if the connection drops, the player says the line again.
Say one line at a time to each character. A line said while the character is still replying is refused rather than queued, because each turn is billed.
Who pays
Only a metered client’s players may hold a conversation, and each turn is billed to that client. A player’s token needs embed:play.