pub struct KnowledgeBase {
pub storage: Storage,
/* private fields */
}Fields§
§storage: StorageImplementations§
Source§impl KnowledgeBase
impl KnowledgeBase
pub fn open(db_path: impl AsRef<Path>) -> Result<Self>
pub fn open_with( db_path: impl AsRef<Path>, embedding: Option<Arc<dyn EmbeddingProvider>>, refiner: Option<Arc<dyn Refiner>>, distiller: Option<Arc<dyn Distiller>>, curator: Option<Arc<dyn Curator>>, sanitizer: Option<Arc<dyn Sanitizer>>, ) -> Result<Self>
pub fn recall( &self, query: &str, budget: usize, trace: bool, include_sparks: bool, top: Option<usize>, source: &str, expand_deps: &str, allow_trim: bool, refine_mode: &str, ) -> Result<RecallResult>
pub fn record( &self, trace_id: &str, query: Option<&str>, output: Option<&str>, output_summary: Option<&str>, outcome: Option<&str>, used: Option<&[String]>, feedback_up: Option<&[String]>, feedback_down: Option<&[String]>, nomination: Option<&str>, priority: i64, source: &str, ) -> Result<()>
pub fn add( &self, content: &str, kind: &str, trigger_desc: Option<&str>, anti_trigger_desc: Option<&str>, source: &str, skill_name: Option<&str>, ) -> Result<String>
pub fn spark( &self, content: &str, trigger_desc: Option<&str>, anti_trigger_desc: Option<&str>, ) -> Result<String>
pub fn mature_spark(&self, spark_id: &str, to: &str) -> Result<()>
pub fn promote_spark(&self, spark_id: &str, to: &str) -> Result<String>
pub fn drop_spark(&self, spark_id: &str, reason: &str) -> Result<()>
pub fn approve(&self, chunk_id: &str) -> Result<()>
pub fn archive(&self, chunk_id: &str, reason: &str) -> Result<()>
pub fn invalidate(&self, chunk_id: &str, reason: &str) -> Result<()>
pub fn restore(&self, chunk_id: &str) -> Result<()>
pub fn evolve(&self, trigger: &str) -> Result<Value>
pub fn inspect(&self) -> Result<Value>
pub fn rebuild_embeddings(&self) -> Result<usize>
pub fn inspect_id(&self, id: &str) -> Result<Value>
Auto Trait Implementations§
impl !Freeze for KnowledgeBase
impl !RefUnwindSafe for KnowledgeBase
impl !Sync for KnowledgeBase
impl !UnwindSafe for KnowledgeBase
impl Send for KnowledgeBase
impl Unpin for KnowledgeBase
impl UnsafeUnpin for KnowledgeBase
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