pub struct ContextPipeline { /* private fields */ }Expand description
A dynamic context pipeline that accumulates
ContextFrames throughout an AI workflow.
Created when an Intent’s content is
first analyzed, seeded with an
IntentAnalysis frame. The
Plan references this pipeline via
pipeline as its context basis. See module documentation for
lifecycle position, eviction rules, and purpose.
Implementations§
Source§impl ContextPipeline
impl ContextPipeline
Sourcepub fn new(created_by: ActorRef) -> Result<Self, String>
pub fn new(created_by: ActorRef) -> Result<Self, String>
Create a new empty pipeline.
After creation, seed it with an IntentAnalysis
frame, then create a Plan that references this
pipeline via pipeline.
pub fn header(&self) -> &Header
Sourcepub fn frames(&self) -> &[ContextFrame]
pub fn frames(&self) -> &[ContextFrame]
Returns all frames in chronological order.
pub fn max_frames(&self) -> u32
pub fn global_summary(&self) -> Option<&str>
pub fn set_max_frames(&mut self, max_frames: u32)
pub fn set_global_summary(&mut self, summary: Option<String>)
Sourcepub fn push_frame(&mut self, kind: FrameKind, summary: impl Into<String>) -> u64
pub fn push_frame(&mut self, kind: FrameKind, summary: impl Into<String>) -> u64
Append a frame, assigning it a stable frame_id.
Returns the assigned frame_id. If max_frames > 0 and the
limit is exceeded, the oldest evictable (non-IntentAnalysis,
non-Checkpoint) frame is removed to make room. Eviction does
not affect the IDs of surviving frames.
Sourcepub fn push_frame_raw(&mut self, frame: ContextFrame) -> u64
pub fn push_frame_raw(&mut self, frame: ContextFrame) -> u64
Append a pre-built frame, overwriting its frame_id with the
next monotonic ID. Returns the assigned frame_id.
Use this when you need to set properties (e.g. token_estimate,
data) on the frame before pushing.
Sourcepub fn frame_by_id(&self, frame_id: u64) -> Option<&ContextFrame>
pub fn frame_by_id(&self, frame_id: u64) -> Option<&ContextFrame>
Look up a frame by its stable frame_id.
Returns None if the frame has been evicted or the ID is invalid.
Sourcepub fn active_frames(&self) -> &[ContextFrame]
pub fn active_frames(&self) -> &[ContextFrame]
Returns frames that contribute to the active context window (i.e. all current frames after any eviction has been applied).
Sourcepub fn total_token_estimate(&self) -> u64
pub fn total_token_estimate(&self) -> u64
Total estimated tokens across all frames.
Trait Implementations§
Source§impl Clone for ContextPipeline
impl Clone for ContextPipeline
Source§fn clone(&self) -> ContextPipeline
fn clone(&self) -> ContextPipeline
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContextPipeline
impl Debug for ContextPipeline
Source§impl<'de> Deserialize<'de> for ContextPipeline
impl<'de> Deserialize<'de> for ContextPipeline
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ContextPipeline
impl Display for ContextPipeline
Source§impl ObjectTrait for ContextPipeline
impl ObjectTrait for ContextPipeline
Source§fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
Source§fn get_type(&self) -> ObjectType
fn get_type(&self) -> ObjectType
fn get_size(&self) -> usize
fn to_data(&self) -> Result<Vec<u8>, GitError>
Source§fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
ReadBoxed<BufRead>.
the input size,is only for new a vec with directive space allocation
the input data stream and output object should be plain base object .Source§fn object_hash(&self) -> Result<ObjectHash, GitError>
fn object_hash(&self) -> Result<ObjectHash, GitError>
Auto Trait Implementations§
impl Freeze for ContextPipeline
impl RefUnwindSafe for ContextPipeline
impl Send for ContextPipeline
impl Sync for ContextPipeline
impl Unpin for ContextPipeline
impl UnsafeUnpin for ContextPipeline
impl UnwindSafe for ContextPipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more