pub struct ConvertConfig {
pub source_language: Option<Language>,
pub source_country: Option<SourceCountry>,
pub output_language: Language,
pub max_chars: usize,
pub correction: Option<CorrectionConfig>,
}Expand description
Configuration for document conversion.
Fields§
§source_language: Option<Language>Language hint for the source document. None = auto-detect.
source_country: Option<SourceCountry>Country/regulatory-region of the source SDS. None = inferred from language.
When set, country-specific extraction rules are injected into the LLM prompt (e.g. China requires 24-hour emergency contact), country-specific validation checks are applied, and a compliance-gap report is generated alongside the JSON.
output_language: LanguageLanguage used for section headings in the generated document.
max_chars: usizeMaximum characters of extracted text sent to the LLM (quality control).
Defaults to 80,000 to capture all 16 SDS sections including transport/regulatory.
CLI overrides this via --quality (low=15k, medium=30k, high=60k).
correction: Option<CorrectionConfig>Opt-in validation-driven correction pass.
When Some, a second targeted LLM call is made after the primary
extraction to fix any invalid GHS H/P-codes found by the validator.
CAS check-digit errors are corrected deterministically (no LLM call).
None (the default) leaves the existing behavior completely unchanged.
Trait Implementations§
Source§impl Clone for ConvertConfig
impl Clone for ConvertConfig
Source§fn clone(&self) -> ConvertConfig
fn clone(&self) -> ConvertConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConvertConfig
impl Debug for ConvertConfig
Auto Trait Implementations§
impl Freeze for ConvertConfig
impl RefUnwindSafe for ConvertConfig
impl Send for ConvertConfig
impl Sync for ConvertConfig
impl Unpin for ConvertConfig
impl UnsafeUnpin for ConvertConfig
impl UnwindSafe for ConvertConfig
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<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 more