Class: Lluminary::Providers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lluminary/providers/base.rb

Overview

Base class for all LLM providers. Defines the interface that all providers must implement.

Direct Known Subclasses

Anthropic, Bedrock, Google, OpenAI, Test

Constant Summary collapse

NAME =

The symbolic name of the provider. Must be overridden by subclasses.

:base

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**config_overrides) ⇒ Base

Returns a new instance of Base.



13
14
15
# File 'lib/lluminary/providers/base.rb', line 13

def initialize(**config_overrides)
  @config = default_provider_config.merge(config_overrides)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/lluminary/providers/base.rb', line 11

def config
  @config
end

Instance Method Details

#call(prompt, task) ⇒ Object

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/lluminary/providers/base.rb', line 17

def call(prompt, task)
  raise NotImplementedError, "Subclasses must implement #call"
end

#modelsObject

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/lluminary/providers/base.rb', line 21

def models
  raise NotImplementedError, "Subclasses must implement #models"
end