Expand description
Conversation-history context providers.
Upstream moved conversation history out of the thread/session entirely:
it is now just another ContextProvider — a HistoryProvider —
that prepends its stored messages ahead of a run (before_run) and
records the run’s request + response messages after a successful run
(after_run). InMemoryHistoryProvider is the in-process default;
FileHistoryProvider persists to a JSON file on disk.
Agent and
WorkflowAgent auto-attach a fresh
InMemoryHistoryProvider (via ensure_history_provider) to any
non-service-managed AgentSession that doesn’t already carry a history
provider, so local multi-turn conversations keep accumulating history the
way the old AgentThread message store used to.
Structs§
- File
History Provider - A
HistoryProviderthat persists to a JSON file on disk, loading any existing history frompathon construction and rewriting the whole file after every successful run. - InMemory
History Provider - In-memory
HistoryProvider: keeps history in anArc<Mutex<Vec<Message>>>, shared across clones.
Traits§
- History
Provider - A
ContextProviderthat also manages conversation history.
Functions§
- ensure_
history_ provider - Attach a fresh
InMemoryHistoryProvideras the first context provider onsessionwhen it is not service-managed and does not already carry a history provider. A no-op for service-managed sessions (the service owns history server-side) and for sessions that already have one attached (detected viaContextProvider::is_history_provider).