pub struct RagContext {
pub history: HistoryManager,
pub skills: SkillsManager,
}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/.
Implementations§
Source§impl RagContext
impl RagContext
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Initialise history and skills from the default openheim data directory.
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 any requested skills. When chat_id refers to an existing conversation the
skills stored on that conversation take precedence over skill_names.
Trait Implementations§
Source§impl Clone for RagContext
impl Clone for RagContext
Source§fn clone(&self) -> RagContext
fn clone(&self) -> RagContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more