Class: Pdf2MarkdownOCR::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf2markdownOCR/configuration.rb

Constant Summary collapse

VALID_MODES =
%i[single_thread multi_thread].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
21
22
23
24
25
26
27
# File 'lib/pdf2markdownOCR/configuration.rb', line 18

def initialize
  @llm_api_url = ENV['LLM_API_URL'] || "http://localhost:8000"
  @llm_model = ENV['LLM_MODEL'] || "deepseek-ai/DeepSeek-OCR-2"
  @png_dpi_resolution = ENV['PNG_DPI'] || 300
  @mode = :multi_thread

  @logger = Logger.new($stdout).tap do |log|
    log.progname = self.class.name.split('::').first
  end
end

Instance Attribute Details

#llm_api_urlObject

Returns the value of attribute llm_api_url.



6
7
8
# File 'lib/pdf2markdownOCR/configuration.rb', line 6

def llm_api_url
  @llm_api_url
end

#llm_modelObject

Returns the value of attribute llm_model.



6
7
8
# File 'lib/pdf2markdownOCR/configuration.rb', line 6

def llm_model
  @llm_model
end

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/pdf2markdownOCR/configuration.rb', line 6

def logger
  @logger
end

#modeObject

Returns the value of attribute mode.



9
10
11
# File 'lib/pdf2markdownOCR/configuration.rb', line 9

def mode
  @mode
end

#png_dpi_resolutionObject

Returns the value of attribute png_dpi_resolution.



6
7
8
# File 'lib/pdf2markdownOCR/configuration.rb', line 6

def png_dpi_resolution
  @png_dpi_resolution
end