Send a message (SSE)
The response is a text/event-stream. OpenAPI cannot describe the event framing:
event: message_start—datais aChatMessageStartEvent. Lala started a message.event: chunk—datais aChatChunkEvent. One text delta. Repeats.event: message_end—datais aChatMessageEndEvent. That message is complete.event: restart—datais aChatRestartEvent. Discard everything streamed so far.event: tool—datais aChatToolEvent. Lala started or finished a tool. Use it to say what Lala is doing while it works. Purely cosmetic: a client may ignore it.event: sync—datais aChatSyncEvent. A tool wrote data the app shows. Reload those screens. Repeats per resource, anddonecarries the whole set again.event: done—datais aChatDoneEvent. The persisted messages and the reactions. Terminal.event: error—datais aChatErrorEvent. Terminal. The status stays 200.
A turn can write to the planner, the deneme history and the profile through tools. The
sync events say which of those changed, as soon as each write lands — refresh them
then rather than waiting for done, so the planner is current when the student
switches to it. done.changed repeats the set for a client that missed an event.
Lala answers in one message most of the time and in several when it writes the way a
person texts. Render each message_start as a new bubble. The messages have no ids
until done, which carries the persisted ChatMessage for each one.
The stream emits exactly one terminal event: done or error. A model failure is an
error event, not an HTTP status. The 4xx responses below occur before the stream only.
Authorizations
Supabase access token: Authorization: Bearer <token>
Body
800010^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The message this one replies to.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
The event stream
The response is of type string.