Class: ActiveAgent::Providers::OpenRouter::Requests::Plugins::PdfConfig

Inherits:
Common::BaseModel
  • Object
show all
Defined in:
lib/active_agent/providers/open_router/requests/plugins/pdf_config.rb

Overview

PDF processing configuration for file-parser plugin

OpenRouter provides multiple PDF processing engines with different capabilities and costs:

  • mistral-ocr: Best for scanned documents or PDFs with images

    • Cost: $2 per 1,000 pages

    • Use when: Document is image-heavy or has poor text extraction

  • pdf-text: Best for well-structured PDFs with clear text content

    • Cost: Free

    • Use when: Document has clean, extractable text

  • native: Use model’s native file processing capabilities

    • Cost: Charged as input tokens

    • Use when: Model supports native file input

If no engine is specified, OpenRouter defaults to the model’s native file processing if available, otherwise uses mistral-ocr.

Examples:

Text extraction (free)

pdf_config = PdfConfig.new(engine: 'pdf-text')

OCR for scanned documents

pdf_config = PdfConfig.new(engine: 'mistral-ocr')

Use model’s native processing

pdf_config = PdfConfig.new(engine: 'native')

See Also:

Instance Attribute Summary collapse

Method Summary

Methods inherited from Common::BaseModel

#<=>, #==, attribute, #deep_compact, #deep_dup, delegate_attributes, drop_attributes, inherited, #initialize, #inspect, keys, #merge!, required_attributes, #serialize, #to_h, #to_hash

Constructor Details

This class inherits a constructor from ActiveAgent::Providers::Common::BaseModel

Instance Attribute Details

#engineString?

Returns PDF processing engine Options: ‘mistral-ocr’, ‘pdf-text’, ‘native’.

Returns:

  • (String, nil)

    PDF processing engine Options: ‘mistral-ocr’, ‘pdf-text’, ‘native’



43
# File 'lib/active_agent/providers/open_router/requests/plugins/pdf_config.rb', line 43

attribute :engine, :string