Class: Legion::Extensions::Llm::Ollama::RegistryPublisher
- Inherits:
-
Object
- Object
- Legion::Extensions::Llm::Ollama::RegistryPublisher
- Defined in:
- lib/legion/extensions/llm/ollama/registry_publisher.rb
Overview
Best-effort publisher for Ollama provider availability events.
Constant Summary collapse
- APP_ID =
'lex-llm-ollama'
Instance Method Summary collapse
-
#initialize(builder: RegistryEventBuilder.new) ⇒ RegistryPublisher
constructor
A new instance of RegistryPublisher.
- #publish_models_async(models, readiness:) ⇒ Object
- #publish_readiness_async(readiness) ⇒ Object
Constructor Details
#initialize(builder: RegistryEventBuilder.new) ⇒ RegistryPublisher
Returns a new instance of RegistryPublisher.
11 12 13 |
# File 'lib/legion/extensions/llm/ollama/registry_publisher.rb', line 11 def initialize(builder: RegistryEventBuilder.new) @builder = builder end |
Instance Method Details
#publish_models_async(models, readiness:) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/legion/extensions/llm/ollama/registry_publisher.rb', line 19 def publish_models_async(models, readiness:) schedule do Array(models).each do |model| publish_event(@builder.model_available(model, readiness:)) end end end |
#publish_readiness_async(readiness) ⇒ Object
15 16 17 |
# File 'lib/legion/extensions/llm/ollama/registry_publisher.rb', line 15 def publish_readiness_async(readiness) schedule { publish_event(@builder.readiness(readiness)) } end |