Class: Lemans::Agents::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lemans/agents/base.rb

Overview

What the harness asks of an agent: install yourself, then work on the instruction. The name-to-class registry lives on the Agents module.

Direct Known Subclasses

Miniswen, Nop, Oracle

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profile:, model: nil) ⇒ Base

Returns a new instance of Base.



12
13
14
15
# File 'lib/lemans/agents/base.rb', line 12

def initialize(profile:, model: nil)
  @profile = profile
  @model = model || profile.model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



10
11
12
# File 'lib/lemans/agents/base.rb', line 10

def model
  @model
end

#profileObject (readonly)

Returns the value of attribute profile.



10
11
12
# File 'lib/lemans/agents/base.rb', line 10

def profile
  @profile
end

Instance Method Details

#call(environment, task:, logs_dir:) ⇒ Object

Raises:

  • (NotImplementedError)


23
# File 'lib/lemans/agents/base.rb', line 23

def call(environment, task:, logs_dir:) = raise(NotImplementedError)

#install(_environment, task:) ⇒ Object

Run before the agent phase's network policy narrows, so an agent that pulls its own runtime can still reach a package index.



21
# File 'lib/lemans/agents/base.rb', line 21

def install(_environment, task:) = nil # rubocop:disable Lint/UnusedMethodArgument

#nameObject



17
# File 'lib/lemans/agents/base.rb', line 17

def name = self.class::NAME