Class: Legion::Extensions::Llm::Bedrock::Actor::FleetWorker

Inherits:
Actors::Subscription
  • Object
show all
Includes:
Logging::Helper
Defined in:
lib/legion/extensions/llm/bedrock/actors/fleet_worker.rb

Overview

Subscription actor for Bedrock fleet request consumption.

The Subscription dispatch path invokes the runner directly as runner_class.send(runner_function, **message) where message is the fully decoded delivery (envelope fields plus metadata headers). runner_class must therefore be the runner constant itself (a String cannot be send-ed) and the runner function must accept the decoded message as keyword arguments.

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


51
52
53
54
55
56
# File 'lib/legion/extensions/llm/bedrock/actors/fleet_worker.rb', line 51

def enabled?
  instances = Bedrock.discover_instances
  enabled = Legion::Extensions::Llm::Fleet::ProviderResponder.enabled_for?(instances)
  log.debug { "bedrock.actor.fleet_worker.enabled?: instances=#{instances.size} enabled=#{enabled}" }
  enabled
end

#runner_classObject



39
40
41
# File 'lib/legion/extensions/llm/bedrock/actors/fleet_worker.rb', line 39

def runner_class
  Legion::Extensions::Llm::Bedrock::Runners::FleetWorker
end

#runner_functionObject



43
44
45
# File 'lib/legion/extensions/llm/bedrock/actors/fleet_worker.rb', line 43

def runner_function
  'handle_fleet_request'
end

#use_runner?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/legion/extensions/llm/bedrock/actors/fleet_worker.rb', line 47

def use_runner?
  false
end