Class: Zwischen::AI::BaseClient

Inherits:
Object
  • Object
show all
Defined in:
lib/zwischen/ai/base_client.rb

Direct Known Subclasses

AnthropicClient, OllamaClient, OpenAIClient

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil, config: {}) ⇒ BaseClient

Returns a new instance of BaseClient.



10
11
12
13
14
# File 'lib/zwischen/ai/base_client.rb', line 10

def initialize(api_key: nil, config: {})
  @api_key = api_key
  @config = config
  validate_config!
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



8
9
10
# File 'lib/zwischen/ai/base_client.rb', line 8

def api_key
  @api_key
end

#configObject (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/zwischen/ai/base_client.rb', line 8

def config
  @config
end

Instance Method Details

#analyze(prompt) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/zwischen/ai/base_client.rb', line 16

def analyze(prompt)
  raise NotImplementedError, "#{self.class.name} must implement #analyze"
end