mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-13 10:55:59 +00:00
094296440f
ViewImageMiddleware persists full base64 image payloads in hide_from_ui human messages inside checkpoints. All REST endpoints that returned serialize_channel_values(channel_values) sent these multi-megabyte payloads to the frontend, freezing the UI on threads with images. Add strip_data_url_image_blocks() to remove data:-scheme image_url content blocks from hide_from_ui messages, and serialize_channel_values_for_api() as a convenience wrapper used by all six affected call sites across threads, runs, and thread_runs routers. SSE streaming is unaffected (still uses serialize_channel_values). Fixes #3496
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
"""LangGraph-compatible runtime — runs, streaming, and lifecycle management.
|
|
|
|
Re-exports the public API of :mod:`~deerflow.runtime.runs` and
|
|
:mod:`~deerflow.runtime.stream_bridge` so that consumers can import
|
|
directly from ``deerflow.runtime``.
|
|
"""
|
|
|
|
from .checkpointer import checkpointer_context, get_checkpointer, make_checkpointer, reset_checkpointer
|
|
from .runs import ConflictError, DisconnectMode, RunContext, RunManager, RunRecord, RunStatus, UnsupportedStrategyError, run_agent
|
|
from .serialization import serialize, serialize_channel_values, serialize_channel_values_for_api, serialize_lc_object, serialize_messages_tuple, strip_data_url_image_blocks
|
|
from .store import get_store, make_store, reset_store, store_context
|
|
from .stream_bridge import END_SENTINEL, HEARTBEAT_SENTINEL, MemoryStreamBridge, StreamBridge, StreamEvent, make_stream_bridge
|
|
|
|
__all__ = [
|
|
# checkpointer
|
|
"checkpointer_context",
|
|
"get_checkpointer",
|
|
"make_checkpointer",
|
|
"reset_checkpointer",
|
|
# runs
|
|
"ConflictError",
|
|
"DisconnectMode",
|
|
"RunContext",
|
|
"RunManager",
|
|
"RunRecord",
|
|
"RunStatus",
|
|
"UnsupportedStrategyError",
|
|
"run_agent",
|
|
# serialization
|
|
"serialize",
|
|
"serialize_channel_values",
|
|
"serialize_channel_values_for_api",
|
|
"serialize_lc_object",
|
|
"serialize_messages_tuple",
|
|
"strip_data_url_image_blocks",
|
|
# store
|
|
"get_store",
|
|
"make_store",
|
|
"reset_store",
|
|
"store_context",
|
|
# stream_bridge
|
|
"END_SENTINEL",
|
|
"HEARTBEAT_SENTINEL",
|
|
"MemoryStreamBridge",
|
|
"StreamBridge",
|
|
"StreamEvent",
|
|
"make_stream_bridge",
|
|
]
|