offload_messages_to_backend(
messages: list[Any],
middleware: SummarizationMiddleware,
*,
thread_id: str| Name | Type | Description |
|---|---|---|
messages* | list[Any] | Messages to offload. |
middleware* | SummarizationMiddleware |
|
thread_id* | str | Thread identifier used to derive the storage path. |
backend* | BackendProtocol |
Write messages to backend storage before offloading.
Appends messages as a timestamped markdown section to the conversation
history file, matching the SummarizationMiddleware offload pattern.
Filters out prior summary messages using the middleware's
_filter_summary_messages to avoid storing summaries-of-summaries.
Backend to persist conversation history to.