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 new() -> SynthesisConfig
pub fn new() -> SynthesisConfig
Create a new config.
Sourcepub fn with_max_tokens_per_page(self, tokens: usize) -> SynthesisConfig
pub fn with_max_tokens_per_page(self, tokens: usize) -> SynthesisConfig
Set max tokens per page.
Sourcepub fn with_max_pages(self, max: usize) -> SynthesisConfig
pub fn with_max_pages(self, max: usize) -> SynthesisConfig
Set max pages.
Sourcepub fn with_pre_summarize(self, enabled: bool) -> SynthesisConfig
pub fn with_pre_summarize(self, enabled: bool) -> SynthesisConfig
Set pre-summarization.
Sourcepub fn with_min_relevance(self, min: f64) -> SynthesisConfig
pub fn with_min_relevance(self, min: f64) -> SynthesisConfig
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§fn default() -> SynthesisConfig
fn default() -> SynthesisConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SynthesisConfig
impl<'de> Deserialize<'de> for SynthesisConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SynthesisConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SynthesisConfig, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 UnsafeUnpin 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