pub struct RagContext {
pub history: HistoryManager,
pub skills: SkillsManager,
pub system: SystemLoader,
/* private fields */
}Expand description
Holds the conversation history store and skill definitions used to build agent prompts.
Fields§
§history: HistoryManagerPersisted conversation history.
skills: SkillsManagerNamed skill files loaded from ~/.openheim/skills/.
system: SystemLoaderSystem identity loaded from ~/.openheim/system.md.
Implementations§
Source§impl RagContext
impl RagContext
Sourcepub fn new(default_skills: Vec<String>) -> Result<Self>
pub fn new(default_skills: Vec<String>) -> Result<Self>
Initialise history, skills, and system identity from the default openheim data directory.
default_skills are merged with any per-session skills on each new conversation.
Sourcepub fn prepare(
&self,
chat_id: Option<Uuid>,
skill_names: &[String],
model: Option<String>,
provider: Option<String>,
) -> Result<(Conversation, PromptBuilder)>
pub fn prepare( &self, chat_id: Option<Uuid>, skill_names: &[String], model: Option<String>, provider: Option<String>, ) -> Result<(Conversation, PromptBuilder)>
Load or create a conversation and build the prompt context for an agent turn.
Returns the resolved Conversation and a PromptBuilder already populated
with the system identity and any requested skills.
For new conversations, default_skills are merged with skill_names (defaults
first, deduplicated) and persisted on the conversation. For existing conversations
the stored skill list is used as-is, preserving the state from when the session began.
Trait Implementations§
Source§impl Clone for RagContext
impl Clone for RagContext
Source§fn clone(&self) -> RagContext
fn clone(&self) -> RagContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RagContext
impl RefUnwindSafe for RagContext
impl Send for RagContext
impl Sync for RagContext
impl Unpin for RagContext
impl UnsafeUnpin for RagContext
impl UnwindSafe for RagContext
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> 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