pub struct SessionRpcHistory<'a> { /* private fields */ }Expand description
session.history.* RPCs.
Implementations§
Source§impl<'a> SessionRpcHistory<'a>
impl<'a> SessionRpcHistory<'a>
Sourcepub async fn compact(&self) -> Result<HistoryCompactResult, Error>
pub async fn compact(&self) -> Result<HistoryCompactResult, Error>
Compacts the session history to reduce context usage.
Wire method: session.history.compact.
§Returns
Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn truncate(
&self,
params: HistoryTruncateRequest,
) -> Result<HistoryTruncateResult, Error>
pub async fn truncate( &self, params: HistoryTruncateRequest, ) -> Result<HistoryTruncateResult, Error>
Truncates persisted session history to a specific event.
Wire method: session.history.truncate.
§Parameters
params- Identifier of the event to truncate to; this event and all later events are removed.
§Returns
Number of events that were removed by the truncation.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn cancel_background_compaction(
&self,
) -> Result<HistoryCancelBackgroundCompactionResult, Error>
pub async fn cancel_background_compaction( &self, ) -> Result<HistoryCancelBackgroundCompactionResult, Error>
Cancels any in-progress background compaction on a local session.
Wire method: session.history.cancelBackgroundCompaction.
§Returns
Indicates whether an in-progress background compaction was cancelled.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn abort_manual_compaction(
&self,
) -> Result<HistoryAbortManualCompactionResult, Error>
pub async fn abort_manual_compaction( &self, ) -> Result<HistoryAbortManualCompactionResult, Error>
Aborts any in-progress manual compaction on a local session.
Wire method: session.history.abortManualCompaction.
§Returns
Indicates whether an in-progress manual compaction was aborted.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn summarize_for_handoff(
&self,
) -> Result<HistorySummarizeForHandoffResult, Error>
pub async fn summarize_for_handoff( &self, ) -> Result<HistorySummarizeForHandoffResult, Error>
Produces a markdown summary of the session’s conversation context for hand-off scenarios.
Wire method: session.history.summarizeForHandoff.
§Returns
Markdown summary of the conversation context (empty when not available).
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Trait Implementations§
Source§impl<'a> Clone for SessionRpcHistory<'a>
impl<'a> Clone for SessionRpcHistory<'a>
Source§fn clone(&self) -> SessionRpcHistory<'a>
fn clone(&self) -> SessionRpcHistory<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more