Class: Legion::Extensions::Llm::Anthropic::RegistryPublisher

Inherits:
Object
  • Object
show all
Includes:
Logging::Helper
Defined in:
lib/legion/extensions/llm/anthropic/registry_publisher.rb

Overview

Best-effort publisher for Anthropic provider availability events.

Constant Summary collapse

APP_ID =
'lex-llm-anthropic'

Instance Method Summary collapse

Constructor Details

#initialize(builder: RegistryEventBuilder.new) ⇒ RegistryPublisher

Returns a new instance of RegistryPublisher.



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

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

Instance Method Details

#publish_models_async(models, readiness:) ⇒ Object



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

def publish_models_async(models, readiness:)
  log.debug { "publishing #{Array(models).size} Anthropic model event(s) to llm.registry" }
  schedule do
    Array(models).each do |model|
      publish_event(@builder.model_available(model, readiness:))
    end
  end
end