Module: ReductoAI

Defined in:
lib/reducto_ai.rb,
lib/reducto_ai/client.rb,
lib/reducto_ai/config.rb,
lib/reducto_ai/engine.rb,
lib/reducto_ai/errors.rb,
lib/reducto_ai/version.rb,
lib/reducto_ai/resources/edit.rb,
lib/reducto_ai/resources/jobs.rb,
lib/reducto_ai/resources/parse.rb,
lib/reducto_ai/resources/split.rb,
lib/reducto_ai/resources/extract.rb,
lib/reducto_ai/resources/pipeline.rb

Overview

Main namespace for the ReductoAI gem.

Provides global configuration management for the Reducto API client. Use ReductoAI.configure to set API credentials and options, then create a Client instance to interact with the Reducto document intelligence API.

Examples:

Basic configuration

ReductoAI.configure do |config|
  config.api_key = ENV.fetch("REDUCTO_API_KEY")
  config.base_url = "https://platform.reducto.ai"
end

client = ReductoAI::Client.new
result = client.parse.sync(input: "https://example.com/document.pdf")

See Also:

Defined Under Namespace

Modules: Resources Classes: AuthenticationError, Client, ClientError, Config, Engine, Error, NetworkError, ServerError

Constant Summary collapse

VERSION =

Gem version

"0.1.1"

Class Method Summary collapse

Class Method Details

.configConfig

Returns the global configuration instance.

Returns:

  • (Config)

    the current configuration object



31
32
33
# File 'lib/reducto_ai.rb', line 31

def config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ void

This method returns an undefined value.

Configures the ReductoAI client globally.

Examples:

Set API key and timeouts

ReductoAI.configure do |config|
  config.api_key = "your-api-key"
  config.open_timeout = 10
  config.read_timeout = 60
end

Yields:

  • (config)

    Gives the configuration object to the block

Yield Parameters:

  • config (Config)

    the configuration instance to modify



47
48
49
# File 'lib/reducto_ai.rb', line 47

def configure
  yield(config)
end

.reset_configuration!void

This method returns an undefined value.

Resets the global configuration to nil.

Primarily used for testing to ensure a clean configuration state.



56
57
58
# File 'lib/reducto_ai.rb', line 56

def reset_configuration!
  @config = nil
end