22#include <neograph/provider.h>
23#include <neograph/types.h>
25#include <asio/awaitable.hpp>
33namespace neograph {
class RuntimeInterpositionController; }
34namespace neograph::history {
79 std::size_t summarized_end = 0;
127 std::vector<sp::Message> messages,
130 int max_tokens = 12000,
137 std::vector<sp::Message> messages,
139 std::shared_ptr<::neograph::RuntimeInterpositionController> controller,
141 int max_tokens = 12000,
NEOGRAPH_API export/import macro for shared-library builds.
Capability identity plus a single prepared, owned operation contract.
CompactionStatus
Why compact_history returned the history it did.
@ NothingEligible
Over budget, but no text-only prefix lies outside the recent_keep tail.
@ UnusableSummary
The summarizer did not stop cleanly (see summary_outcome's stop kind); history kept.
@ Compacted
A clean summary replaced the eligible prefix.
@ UnderBudget
estimate_tokens(messages) <= max_tokens; no summarizer call was made.
@ EmptySummary
The summarizer completed cleanly but text is empty/ASCII whitespace; history kept.
@ NativeReplayProtected
Over budget with native seals bound to the prefix; full history kept without dispatch.
NEOGRAPH_API asio::awaitable< CompactedHistory > compact_history(std::vector< sp::Message > messages, Provider &provider, std::string model, int max_tokens=12000, int recent_keep=6, ProviderControls summary_controls=default_summary_controls())
Summarize old turns when the history exceeds a token budget.
NEOGRAPH_API ProviderControls default_summary_controls()
Defaults when the caller does not supply ProviderControls: max_output_tokens 500, and no sampling or ...
NEOGRAPH_API int estimate_tokens(const std::vector< sp::Message > &messages)
Rough token estimate for a message list.
NEOGRAPH_API void sanitize_tool_calls(std::vector< sp::Message > &messages)
Validate client-executed tool pairings without editing any message or part.
Typed per-call controls translated into the selected SDK provider family.
Result of compact_history.
sp::runtime::Result summary_outcome
Full immutable summarizer response; null when no summarizer call was made (UnderBudget / NothingEligi...
std::string summary
LLM summary of the compacted span ("" unless status == Compacted).
bool compacted
true iff status == Compacted.
std::vector< sp::Message > recent
The history to continue with; equals the input unless status == Compacted.
std::size_t summarized_begin
Half-open range [summarized_begin, summarized_end) of INPUT message indices that the summary replaced...