#[non_exhaustive]pub struct IngestSettings { /* private fields */ }Expand description
Settings for ingest_dir. Defaults: scope docs, chunks of 200
tokens with 20 of overlap, the safe folder walk of LoadSettings and
Origin::External, so folder text is fenced as untrusted in prompts.
A run never removes more than half the scope, or all of it from an
empty folder, unless allowed. Changed origin or chunk config re-ingests.
Implementations§
Source§impl IngestSettings
impl IngestSettings
Sourcepub fn with_scope(self, scope: impl Into<String>) -> Self
pub fn with_scope(self, scope: impl Into<String>) -> Self
Sets the scope every chunk is stored under.
Must not be blank; ingest_dir refuses a blank scope.
Default docs.
Sourcepub fn with_chunk(self, chunk: ChunkConfig) -> Self
pub fn with_chunk(self, chunk: ChunkConfig) -> Self
Sets the chunk size and overlap, in estimated tokens. Checked by the chunker on the first file. Default 200 tokens with 20 of overlap.
Sourcepub fn with_load(self, load: LoadSettings) -> Self
pub fn with_load(self, load: LoadSettings) -> Self
Sets the folder walk bounds and filters.
A walk cap error stops the ingest before any write.
Default LoadSettings::default().
Sourcepub fn with_origin(self, origin: Origin) -> Self
pub fn with_origin(self, origin: Origin) -> Self
Sets the origin stored on every chunk.
Internal text is put in prompts unfenced; use it only for text
the app wrote itself. Default Origin::External.
Sourcepub fn with_allow_remove_all(self, allow: bool) -> Self
pub fn with_allow_remove_all(self, allow: bool) -> Self
Allows a run to remove any number of sources, all of them included, for a folder that was emptied on purpose. Off, a walk that finds no supported file while the scope has sources is refused. Default off.
Sets the largest share of the scope’s sources, in percent 0 to 100,
one run may remove; a run above it is refused with the planned
count before any write. Ignored with allow_remove_all. Default 50.
Sourcepub fn allow_remove_all(&self) -> bool
pub fn allow_remove_all(&self) -> bool
Returns whether a run may remove every source of the scope. Guards against an unmounted or mistyped folder. Default false.
Returns the largest share of sources, in percent, one run removes. Above it the run is refused before any write. Default 50.
Sourcepub fn scope(&self) -> &str
pub fn scope(&self) -> &str
Returns the scope every chunk is stored under.
It is the scope meta value of each chunk.
Default docs.
Sourcepub fn chunk(&self) -> ChunkConfig
pub fn chunk(&self) -> ChunkConfig
Returns the chunk size and overlap. In estimated tokens of four chars. Default 200 and 20.
Sourcepub fn load(&self) -> &LoadSettings
pub fn load(&self) -> &LoadSettings
Returns the folder walk settings.
Their caps bound one ingest.
Default LoadSettings::default().
Trait Implementations§
Source§impl Clone for IngestSettings
impl Clone for IngestSettings
Source§impl Debug for IngestSettings
impl Debug for IngestSettings
Source§impl Default for IngestSettings
impl Default for IngestSettings
impl Eq for IngestSettings
Source§impl PartialEq for IngestSettings
impl PartialEq for IngestSettings
impl StructuralPartialEq for IngestSettings
Auto Trait Implementations§
impl Forget for IngestSettings
impl Freeze for IngestSettings
impl Move for IngestSettings
impl RefUnwindSafe for IngestSettings
impl Send for IngestSettingswhere
RawVecInner: Send,
impl Sync for IngestSettingswhere
RawVecInner: Sync,
impl Unpin for IngestSettings
impl UnsafeUnpin for IngestSettingswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for IngestSettingswhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.