1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Data types that flow through the cupel pipeline.
//!
//! This module defines the core value types used at every stage of the context
//! selection pipeline. Items enter as [`ContextItem`] instances, are scored into
//! [`ScoredItem`] records, and selected under a [`ContextBudget`].
//!
//! # Key types
//!
//! | Type | Purpose |
//! |------|---------|
//! | [`ContextItem`] | An immutable record representing a single piece of context |
//! | [`ContextItemBuilder`] | Builder for constructing `ContextItem` instances |
//! | [`ContextBudget`] | Token budget constraints for the pipeline |
//! | [`ContextKind`] | Extensible classification of context type (e.g. Message, Document) |
//! | [`ContextSource`] | Extensible identification of context origin (e.g. Chat, Tool) |
//! | [`OverflowStrategy`] | Controls behavior when selected items exceed the budget |
//! | [`ScoredItem`] | Associates a `ContextItem` with its computed relevance score |
//!
//! Timestamps use [`chrono::DateTime<Utc>`] for timezone-aware ordering.
//!
//! # Example
//!
//! ```
//! # use std::collections::HashMap;
//! use cupel::{ContextItemBuilder, ContextBudget, ContextKind};
//!
//! // Build a context item
//! let item = ContextItemBuilder::new("You are a helpful assistant.", 8)
//! .kind(ContextKind::new("SystemPrompt")?)
//! .build()?;
//!
//! assert_eq!(item.tokens(), 8);
//!
//! // Create a budget
//! let budget = ContextBudget::new(4096, 3000, 1024, HashMap::new(), 5.0)?;
//! assert_eq!(budget.max_tokens(), 4096);
//! # Ok::<(), cupel::CupelError>(())
//! ```
pub use ContextBudget;
pub use ;
pub use ;
pub use ContextSource;
pub use OverflowStrategy;
pub use ScoredItem;