#[non_exhaustive]pub struct Config {Show 19 fields
pub root_dir: PathBuf,
pub output_dir: PathBuf,
pub output_pattern: String,
pub format: OutputFormat,
pub max_tokens: usize,
pub overlap_tokens: usize,
pub chunk_safety_margin: usize,
pub tokenizer: TokenizerKind,
pub prefer_line_boundaries: bool,
pub filter_config: FilterConfig,
pub file_filter_config: FileFilterConfig,
pub preset: Option<PresetKind>,
pub dry_run: bool,
pub include_binary_files: bool,
pub backup_existing: bool,
pub template_path: Option<PathBuf>,
pub custom_format_name: Option<String>,
pub custom_extension: Option<String>,
pub custom_data: HashMap<String, Value>,
}Expand description
Configuration for the llm-utl pipeline.
Use Config::builder() to construct a new configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.root_dir: PathBufRoot directory to scan for files
output_dir: PathBufOutput directory for generated prompts
output_pattern: StringOutput filename pattern (supports {index}, {index:03}, {ext})
format: OutputFormatOutput format
max_tokens: usizeMaximum tokens per chunk
overlap_tokens: usizeOverlap tokens between chunks for context continuity
chunk_safety_margin: usizeSafety margin to prevent exceeding limits
tokenizer: TokenizerKindTokenizer implementation to use
prefer_line_boundaries: boolWhether to prefer splitting at line boundaries
filter_config: FilterConfigCode filtering configuration
file_filter_config: FileFilterConfigCode filtering configuration
preset: Option<PresetKind>LLM preset for specialized output
dry_run: boolDry run mode (no file writes)
include_binary_files: boolInclude binary files in output
backup_existing: boolCreate backups of existing files
template_path: Option<PathBuf>Path to external template file
custom_format_name: Option<String>Custom format name (used with Custom output format)
custom_extension: Option<String>Custom file extension (used with Custom output format)
custom_data: HashMap<String, Value>Custom data to pass to templates
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder() -> ConfigBuilder
pub fn builder() -> ConfigBuilder
Creates a new configuration builder.
§Examples
use llm_utl::Config;
let config = Config::builder()
.root_dir("./src")
.max_tokens(50_000)
.build()
.expect("valid configuration");Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates the configuration.
§Errors
Returns an error if:
- Root directory doesn’t exist
- Token limits are invalid
- Output pattern is invalid
Sourcepub const fn effective_chunk_size(&self) -> usize
pub const fn effective_chunk_size(&self) -> usize
Returns the effective chunk size after applying safety margin.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)