Class: ActiveAgent::GenerationProvider::Base

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

Direct Known Subclasses

OpenAIProvider

Defined Under Namespace

Classes: GenerationProviderError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
# File 'lib/active_agent/generation_provider/base.rb', line 9

def initialize(config)
  @config = config
  @prompt = nil
  @response = nil
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/active_agent/generation_provider/base.rb', line 7

def client
  @client
end

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/active_agent/generation_provider/base.rb', line 7

def config
  @config
end

#promptObject (readonly)

Returns the value of attribute prompt.



7
8
9
# File 'lib/active_agent/generation_provider/base.rb', line 7

def prompt
  @prompt
end

Instance Method Details

#generate(prompt) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/active_agent/generation_provider/base.rb', line 15

def generate(prompt)
  raise NotImplementedError, "Subclasses must implement the 'generate' method"
end