pub struct BuildConfig {
pub chunk_size: usize,
pub slide_len: usize,
pub image_size: usize,
pub min_summary_len: usize,
pub max_summary_len: usize,
pub strict_file_reader: bool,
pub compression_threshold: u64,
pub compression_level: u32,
pub summary_after_build: bool,
}Fields§
§chunk_size: usizeIt’s not a max_chunk_size, and it’s impossible to make every chunk have the same size because
- An image cannot be splitted.
- Different files cannot be merged.
But it’s guaranteed that a chunk is never bigger than chunk_size * 2.
slide_len: usize§image_size: usizeAn image is treated like an N characters string, and this is N.
min_summary_len: usizeIt forces the LLM to generate a summary that has at least min_summary_len characters
and at most max_summary_len characters.
max_summary_len: usize§strict_file_reader: boolIf it’s set, rag build panics if there’s any error with a file.
For example, if there’s an invalid utf-8 character PlainTextReader would die.
If it cannot follow a link of an image in a markdown file, it would die.
You don’t need this option unless you’re debugging ragit itself.
compression_threshold: u64If the .chunks file is bigger than this (in bytes), the file is compressed
compression_level: u320 ~ 9
summary_after_build: boolIf it’s set, it runs rag summary after rag build is complete.
Trait Implementations§
Source§impl Clone for BuildConfig
impl Clone for BuildConfig
Source§fn clone(&self) -> BuildConfig
fn clone(&self) -> BuildConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildConfig
impl Debug for BuildConfig
Source§impl Default for BuildConfig
impl Default for BuildConfig
Source§impl<'de> Deserialize<'de> for BuildConfig
impl<'de> Deserialize<'de> for BuildConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for BuildConfig
impl Hash for BuildConfig
Source§impl PartialEq for BuildConfig
impl PartialEq for BuildConfig
Source§impl Serialize for BuildConfig
impl Serialize for BuildConfig
impl Eq for BuildConfig
impl StructuralPartialEq for BuildConfig
Auto Trait Implementations§
impl Freeze for BuildConfig
impl RefUnwindSafe for BuildConfig
impl Send for BuildConfig
impl Sync for BuildConfig
impl Unpin for BuildConfig
impl UnwindSafe for BuildConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().