Class: Legion::Extensions::Llm::Bedrock::RegistryPublisher

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/extensions/llm/bedrock/registry_publisher.rb

Overview

Best-effort publisher for Bedrock provider availability events.

Constant Summary collapse

APP_ID =
'lex-llm-bedrock'

Instance Method Summary collapse

Constructor Details

#initialize(builder: RegistryEventBuilder.new) ⇒ RegistryPublisher

Returns a new instance of RegistryPublisher.



11
12
13
# File 'lib/legion/extensions/llm/bedrock/registry_publisher.rb', line 11

def initialize(builder: RegistryEventBuilder.new)
  @builder = builder
end

Instance Method Details

#publish_offerings_async(offerings, readiness:) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/legion/extensions/llm/bedrock/registry_publisher.rb', line 19

def publish_offerings_async(offerings, readiness:)
  schedule do
    Array(offerings).each do |offering|
      publish_event(@builder.offering_available(offering, readiness:))
    end
  end
end

#publish_readiness_async(readiness) ⇒ Object



15
16
17
# File 'lib/legion/extensions/llm/bedrock/registry_publisher.rb', line 15

def publish_readiness_async(readiness)
  schedule { publish_event(@builder.readiness(readiness)) }
end