mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
Add StreamingService and interrupt correlation for chat streams.
This commit is contained in:
parent
fc429d8702
commit
fef7621d96
3 changed files with 518 additions and 0 deletions
20
surfsense_backend/app/services/streaming/__init__.py
Normal file
20
surfsense_backend/app/services/streaming/__init__.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"""Single-responsibility split of the streaming SSE protocol.
|
||||
|
||||
Layout:
|
||||
* ``envelope/`` - SSE wire framing + ID generators
|
||||
* ``emitter/`` - identity of the agent that emitted an event + runtime registry
|
||||
* ``events/`` - one module per SSE event family
|
||||
* ``service.py`` - composition root used by the orchestrator
|
||||
* ``interrupt_correlation.py`` - id-aware lookup over LangGraph state
|
||||
|
||||
Naming on the wire:
|
||||
* AI SDK protocol fields keep their existing camelCase
|
||||
(``toolCallId``, ``messageId``, ``inputTextDelta``, ``langchainToolCallId``).
|
||||
* Every SurfSense-added field uses ``snake_case``, including the
|
||||
top-level ``emitted_by`` envelope and all inner ``data`` payloads.
|
||||
|
||||
Production keeps using ``app.services.new_streaming_service`` and
|
||||
``app.tasks.chat.stream_new_chat`` until the cutover phase.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
Loading…
Add table
Add a link
Reference in a new issue