pub struct SynthesisConfig {
pub max_tokens_per_page: usize,
pub max_pages: usize,
pub pre_summarize: bool,
pub summary_tokens: usize,
pub include_relevance: bool,
pub min_relevance: f64,
}Expand description
Configuration for multi-page synthesis.
Fields§
§max_tokens_per_page: usizeMaximum tokens to allocate per page.
max_pages: usizeMaximum number of pages to synthesize at once.
pre_summarize: boolWhether to pre-summarize long pages before synthesis.
summary_tokens: usizeToken budget for pre-summarization.
include_relevance: boolWhether to include page relevance scores.
min_relevance: f64Minimum relevance score to include a page.
Implementations§
Source§impl SynthesisConfig
impl SynthesisConfig
Sourcepub fn with_max_tokens_per_page(self, tokens: usize) -> Self
pub fn with_max_tokens_per_page(self, tokens: usize) -> Self
Set max tokens per page.
Sourcepub fn with_max_pages(self, max: usize) -> Self
pub fn with_max_pages(self, max: usize) -> Self
Set max pages.
Sourcepub fn with_pre_summarize(self, enabled: bool) -> Self
pub fn with_pre_summarize(self, enabled: bool) -> Self
Set pre-summarization.
Sourcepub fn with_min_relevance(self, min: f64) -> Self
pub fn with_min_relevance(self, min: f64) -> Self
Set minimum relevance.
Sourcepub fn tokens_per_page(&self, total_budget: usize, page_count: usize) -> usize
pub fn tokens_per_page(&self, total_budget: usize, page_count: usize) -> usize
Calculate token budget per page given total budget and page count.
Trait Implementations§
Source§impl Clone for SynthesisConfig
impl Clone for SynthesisConfig
Source§fn clone(&self) -> SynthesisConfig
fn clone(&self) -> SynthesisConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SynthesisConfig
impl Debug for SynthesisConfig
Source§impl Default for SynthesisConfig
impl Default for SynthesisConfig
Source§impl<'de> Deserialize<'de> for SynthesisConfig
impl<'de> Deserialize<'de> for SynthesisConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SynthesisConfig
impl PartialEq for SynthesisConfig
Source§impl Serialize for SynthesisConfig
impl Serialize for SynthesisConfig
impl StructuralPartialEq for SynthesisConfig
Auto Trait Implementations§
impl Freeze for SynthesisConfig
impl RefUnwindSafe for SynthesisConfig
impl Send for SynthesisConfig
impl Sync for SynthesisConfig
impl Unpin for SynthesisConfig
impl UnwindSafe for SynthesisConfig
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