Class: ActiveAgent::Providers::Base

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

Direct Known Subclasses

Anthropic, Gemini, Ollama, OpenAI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model:, api_key: nil, api_url: nil) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
# File 'lib/active_agent/providers/base.rb', line 12

def initialize(model:, api_key: nil, api_url: nil)
  @model = model
  @api_key = api_key
  @api_url = api_url
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



10
11
12
# File 'lib/active_agent/providers/base.rb', line 10

def api_key
  @api_key
end

#api_urlObject (readonly)

Returns the value of attribute api_url.



10
11
12
# File 'lib/active_agent/providers/base.rb', line 10

def api_url
  @api_url
end

#modelObject (readonly)

Returns the value of attribute model.



10
11
12
# File 'lib/active_agent/providers/base.rb', line 10

def model
  @model
end

Instance Method Details

#chat(messages:, tools: []) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/active_agent/providers/base.rb', line 18

def chat(messages:, tools: [])
  raise NotImplementedError, "#{self.class.name}#chat must be implemented"
end