Skip to main content

DocumentExtractionModel

Trait DocumentExtractionModel 

Source
pub trait DocumentExtractionModel: ModelInfo {
    // Required method
    fn extract<'life0, 'async_trait>(
        &'life0 self,
        pages: Vec<ImageInput>,
        options: DocExtractOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DocExtractResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn warmup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A vision-language model that extracts structured blocks from document page images.

Targets MinerU-2.5, Granite-Docling, olmOCR-2, and similar VLMs that understand page layout, tables, figures, and math. The caller is responsible for rendering PDF pages to images upstream — uni-xervo providers do not own PDF rendering.

Required Methods§

Source

fn extract<'life0, 'async_trait>( &'life0 self, pages: Vec<ImageInput>, options: DocExtractOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<DocExtractResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Extract structured blocks from one or more page images.

Returns one DocExtractResult per page, in input order.

§Errors

Returns an error if the provider rejects an input or fails internally.

Provided Methods§

Source

fn warmup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Optional warmup hook. The default is a no-op.

§Errors

Returns an error if the underlying model fails to initialize.

Implementors§