Stream Steps Sse
Stream agent reasoning steps as Server-Sent Events.
Validates the thread, builds a per-request React agent, captures a
workspace snapshot, then feeds the user’s message into the agent and
yields each intermediate state as a JSON SSE event. Deduplication logic
prevents re-emitting the same message twice if LangGraph yields it in
multiple stream frames. Tool messages whose envelope carries an
artifact block produce a separate artifact SSE event so the
centre panel can update mid-turn.
Args:
payload: Query text, optional thread_id, and optional runtime config.
request: The raw HTTP request for IP logging.
user: The authenticated user (injected by require_user).
db: Database session for audit logging.
Returns:
A StreamingResponse of SSE events.
Authorizations
A personal access token (haico_pat_...), created under Profile → API keys. Send it as Authorization: Bearer <key>. The browser session JWT is also accepted but is an internal mechanism and is not part of the public contract.
Body
Response
Successful Response